Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit 5334b2e

Browse files
authored
Adds custom docker file for the project (#36)
A temporary solution. It isn't perfect as the utilities from `ContainerInterface` in IsaacLab hasn't been propogated. Fixes #8
1 parent 09ed445 commit 5334b2e

File tree

5 files changed

+159
-0
lines changed

5 files changed

+159
-0
lines changed

.dockerignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ignore .git related folders
2+
.git/
3+
.github/
4+
.gitignore
5+
# ignore docs
6+
docs/
7+
# ignore logs
8+
**/logs/
9+
**/runs/
10+
**/output/*
11+
**/outputs/*
12+
**/videos/*
13+
*.tmp
14+
# ignore docker
15+
docker/cluster/exports/
16+
docker/.container.cfg
17+
# ignore recordings
18+
recordings/
19+
# ignore __pycache__
20+
**/__pycache__/
21+
**/*.egg-info/
22+
# ignore isaac sim symlink
23+
_isaac_sim?

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,80 @@ To enable your extension, follow these steps:
7979
- Find your extension under the `Third Party` category.
8080
- Toggle it to enable your extension.
8181

82+
## Docker setup
83+
84+
### Building Isaac Lab Base Image
85+
86+
Currently, we don't have the Docker for Isaac Lab publicly available. Hence, you'd need to build the docker image
87+
for Isaac Lab locally by following the steps [here](https://isaac-sim.github.io/IsaacLab/source/deployment/index.html).
88+
89+
Once you have built the base Isaac Lab image, you can check it exists by doing:
90+
91+
```bash
92+
docker images
93+
94+
# Output should look something like:
95+
#
96+
# REPOSITORY TAG IMAGE ID CREATED SIZE
97+
# isaac-lab-base latest 28be62af627e 32 minutes ago 18.9GB
98+
```
99+
100+
### Building Isaac Lab Template Image
101+
102+
Following above, you can build the docker container for this project. It is called `isaac-lab-template`. However,
103+
you can modify this name inside the [`docker/docker-compose.yaml`](docker/docker-compose.yaml).
104+
105+
```bash
106+
cd docker
107+
docker compose --env-file .env.base --file docker-compose.yaml build isaac-lab-template
108+
```
109+
110+
You can verify the image is built successfully using the same command as earlier:
111+
112+
```bash
113+
docker images
114+
115+
# Output should look something like:
116+
#
117+
# REPOSITORY TAG IMAGE ID CREATED SIZE
118+
# isaac-lab-template latest 00b00b647e1b 2 minutes ago 18.9GB
119+
# isaac-lab-base latest 892938acb55c About an hour ago 18.9GB
120+
```
121+
122+
### Running the container
123+
124+
After building, the usual next step is to start the containers associated with your services. You can do this with:
125+
126+
```bash
127+
docker compose --env-file .env.base --file docker-compose.yaml up
128+
```
129+
130+
This will start the services defined in your `docker-compose.yaml` file, including isaac-lab-template.
131+
132+
If you want to run it in detached mode (in the background), use:
133+
134+
```bash
135+
docker compose --env-file .env.base --file docker-compose.yaml up -d
136+
```
137+
138+
### Interacting with a running container
139+
140+
If you want to run commands inside the running container, you can use the `exec` command:
141+
142+
```bash
143+
docker exec --interactive --tty -e DISPLAY=${DISPLAY} isaac-lab-template /bin/bash
144+
```
145+
146+
### Shutting down the container
147+
148+
When you are done or want to stop the running containers, you can bring down the services:
149+
150+
```bash
151+
docker compose --env-file .env.base --file docker-compose.yaml down
152+
```
153+
154+
This stops and removes the containers, but keeps the images.
155+
82156
## Code formatting
83157

84158
We have a pre-commit template to automatically format your code.

docker/.env.base

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
###
2+
# General settings
3+
###
4+
5+
# Isaac Lab base image
6+
ISAACLAB_BASE_IMAGE=isaac-lab-base
7+
# The Isaac Lab Extension Template path in the container
8+
DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH=/workspace/isaaclab_extension_template

docker/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ARG ISAACLAB_BASE_IMAGE_ARG
2+
3+
# we use the basic isaaclab image as the base
4+
FROM ${ISAACLAB_BASE_IMAGE_ARG} AS base
5+
6+
ARG DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH_ARG
7+
ENV DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH=${DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH_ARG}
8+
9+
USER root
10+
11+
# Copy the Isaac Lab Extension Template directory (files to exclude are defined in .dockerignore)
12+
COPY ../ ${DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH}
13+
14+
# # Install whatever you need as additional dependencies.
15+
RUN bash -i -c "source ${HOME}/.bashrc && \
16+
cd ${DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH}/exts/ext_template && \
17+
pip install -e ."
18+
19+
# make working directory as the Isaac Lab directory
20+
# this is the default directory when the container is run
21+
WORKDIR /workspace

docker/docker-compose.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
x-default-isaac-lab-template-environment: &default-isaac-lab-template-environment
2+
- OMNI_KIT_ALLOW_ROOT=1
3+
4+
x-default-isaac-lab-template-deploy: &default-isaac-lab-template-deploy
5+
resources:
6+
reservations:
7+
devices:
8+
- driver: nvidia
9+
count: all
10+
capabilities: [ gpu ]
11+
12+
services:
13+
isaac-lab-template:
14+
env_file: .env.base
15+
build:
16+
context: ../
17+
dockerfile: docker/Dockerfile
18+
args:
19+
- ISAACLAB_BASE_IMAGE_ARG=${ISAACLAB_BASE_IMAGE}
20+
- DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH_ARG=${DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH}
21+
image: isaac-lab-template
22+
container_name: isaac-lab-template
23+
volumes:
24+
- type: bind
25+
source: ../
26+
target: ${DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH}
27+
network_mode: host
28+
environment: *default-isaac-lab-template-environment
29+
deploy: *default-isaac-lab-template-deploy
30+
# This is the entrypoint for the container
31+
entrypoint: bash
32+
stdin_open: true
33+
tty: true

0 commit comments

Comments
 (0)