This repository makes it easy to start developing ROS applications within a Docker development environment.
The ROS distribution version is selected by specifying the distribution name to
the env_setup.sh
script.
-
Setup
.env
and.docker.xauth
files for Docker Compose and to enable GUI access:./env_setup.sh noetic
This will create a
.env
file that Docker Compose will read in. -
Starting with the OSRF Desktop Docker Image, build your own Docker Image:
docker compose build
-
Start the Docker container:
docker compose up -d dev
-
Step into the running Docker container:
docker exec -it --user ros ros_noetic /bin/bash
-
Bring the Docker container down
docker compose down
-
Setup
.env
and.docker.xauth
files for Docker Compose and to enable GUI access:./env_setup.sh humble
-
Starting with the OSRF Desktop Docker Image, build your own Docker Image:
docker compose build
-
Start the Docker container:
docker compose up -d dev
-
Step into the running Docker container:
docker exec -it --user ros ros_humble /bin/bash
-
Bring the Docker container down
docker compose down
To mount code from your local system into the container:
-
Start by setting up a ROS workspace directory structure on your host system. For example:
mkdir -p ~/ros1/workspace_2/src
-
Clone your git repos into the
~/ros1/workspace_2/src/
directory -
Update the
docker-compose.yml
file to mount thissrc
folder by adding an item to thevolumes
list:- ${HOME}/ros1/workspace_2/src:/home/ros/workspace/src
-
After running
docker compose up -d
and stepping into the container withdocker exec
you should be able to runcatkin_make
to build the workspace.
-
You can use the
dev-nvidia
service if you have an NVIDIA GPU. To use your NVIDIA runtime, specify thedev-nvidia
service when starting the container:docker compose up -d dev-nvidia
Test that that NVIDIA runtime is working by running the
nvidia-smi
command.