Doing a Docker installation is a great method for setting up the repository on any operating system that isn't Ubuntu 22.04. It is a faster and more lightweight alternative to a traditional Virtual Machine. In addition, you can still run GUI applications like Gazebo using the NoVNC desktop environment.
- If you are on Linux, add yourself to the
dockergroup. Being a member of thedockergroup allows you to rundockerwithoutsudo.
sudo groupadd docker
sudo usermod -aG docker $USERAfter you complete the installation, restart your computer!
To check that everything installed OK, you should be able to open the command line and type:
dockerYou do not have to use VS Code. However, VS Code has very nice extensions for using Docker containers.
Search for and install the following extensions in VS Code
- Docker
- DevContainers
- ROS
- C/C++
- CMake
Install Git using the instructions here
You can either pull the image from Dockerhub or build the image manually using a Dockerfile. Pulling from Dockerhub is faster, easier, and less error-prone. However, if you want to edit the Dockerfile for some reason, do the manual build instructions.
docker pull robojackets/urc-gui-baseimageThe docker container is essentially a self-contained instance of Ubuntu 22.04, but can access some files on your system in a limited way. We use this so the container can see the repositories you clone locally, that way both local development and containerized testing can be done without any delays.
You can place this directory wherever you want, I recommend /home for Mac/Linux and C:\Users\[Username]\ for Windows
mkdir urc_containerOur installation script will
- Clone all necessary repos
- Automatically setup your desktop NoVNC environment
If on Windows, you will need to use Git Bash to run the following commands!
Run this command only if you are on Mac/Linux
chmod +x setup.sh./setup.shFor beginners to Docker:
- Go to
localhost:6060in your web browser of choice
Recommended way:
- Open up VS Code
- Click on the whale Docker icon on your left
- Right click the currently running container (Should be called tiryoh/ros2)
- Select open in browser
Open terminator in the desktop (this is the recommended terminal for commands in your container)
In terminator, run
cd urc_containerFirst, it's always a good idea to check for updates. Nothing will happen if you just created the image. However, if you decide to re-create the container a while after you made the initial image, you will need to update those packages.
sudo apt update
sudo apt upgradecd /rover_ws
rosdep update && rosdep install --from-paths src --ignore-src -r -yNow, it's time for the moment of truth!
colcon build- Work on your code in
urc_containerlocally to avoid input lag - When ready to test, you can build and run your code in the container just like on native Ubuntu!
Once you are done with the conatiner, be sure to close the Docker container. Otherwise, the Docker container will take up a big chunk of memory on your computer.
-
- Go to the Docker tab in VS Code
- Right click the container (it has a green arrow next to it if already running)
- Press stop/start
-
- Go to where you placed
urc_containerlocally - Run
./setup.sh stopto stop - Run
./setup.sh startto start up again
- Go to where you placed
The below steps are for a faster docker container. However, there are a few caveats: running graphical
Open a terminal (or Git Bash on Windows), create a folder where you want the repository to be located, navigate to that folder, and run:
mkdir rover_ws
cd rover_ws && git clone https://github.com/RoboJackets/urc-software srcdocker pull osrf/ros:humble-desktopThe first time, you will have to navigate to the docker folder (located inside rover_ws/src/docker) and run the following command:
docker compose upYou can open another terminal and run docker exec -it ros_desktop bash to access the container. For subsequent launches, it is recommended to use VS Code to connect to the container and develop inside the container.
Open VS Code, press F1, and select Dev Containers: Attach to Running Container.... Then select the container named ros_desktop.
You should now be conneceted to the container and can open the folder /home/rover_ws to start working on the code.
To make sure that ROS is sourced every time you open a new terminal in the container, run the following command inside the docker container:
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrcRun the following commands inside the docker container:
sudo apt update
rosdep update
cd /home/rover_ws
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install

