Home

Awesome

rosdocker 🤖 🐳

<!-- TOC --> <!-- /TOC -->

This repository contains a set of tools that simplifies the management of docker containers and (ROS) images with transparent support of NVIDIA drivers. You can play with it to create your own custom docker containers, smoothly open many terminals connected to them, and move from one container to another one. A docker cheatsheet is available here.

Main features:


Requirements

Check you have installed the nvidia-docker-toolkit:
$ sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit-base

Usage

Configuration

In the file config.sh, set your favorite working folder WORKING_FOLDER_TO_MOUNT_IN_CONTAINER. This folder will be mounted from the host into the run container so that we can conveniently work ont it and preserve changes. By default:
WORKING_FOLDER_TO_MOUNT_IN_CONTAINER="$HOME/Work"

Build and run

Consider one of our available dockerfiles Dockerfile_<NAME>.

For instance, if you want to build, run and stop the noetic container/image corresponding to Dockerfile_noetic, then run:
$ ./build.sh noetic
$ ./run.sh noetic
$ ./stop.sh noetic

NOTE1: When you update your Nvidia drivers, rebuild the image with the build.sh script.

NOTE2: any change made outside of our folder WORKING_FOLDER_TO_MOUNT_IN_CONTAINER from within the docker environment will not persist. If you want to add additional binary packages without having to reinstall them each time, add them to the Dockerfile and rebuild. This is a well known rule for docker users.


Available Images and Dockerfiles

Each image <NAME> listed below corresponds to a dockerfile: Dockerfile_<NAME>.

An old heritage:

Now, you can easily add your new custom docker file.


3DMR

In order to build the noetic_3dmr image, which can host the 3DMR project, check you are connected to the network and run these commands:
$ ./build.sh noetic
$ ./build.sh noetic_3dmr

Now, set your folder $WORKING_FOLDER_TO_MOUNT_IN_CONTAINER (see the configuration section). From your host, open a terminal and clone the 3DMR project into $WORKING_FOLDER_TO_MOUNT_IN_CONTAINER. Then, run the container noetic_3dmr:
$ ./run.sh noetic_3dmr.
Next, from within the run container, get into the folder $WORKING_FOLDER_TO_MOUNT_IN_CONTAINER, and build the workspace (see the instructions and scripts in 3DMR).


pyslam

To build the pyslam / pyslam_cuda image, which can host the pyslam project, check you are connected to the network and run:
$ ./build.sh pyslam
or
$ ./build.sh pyslam_cuda if your system supports NVIDIA CUDA
Then, open a terminal and run:
$ ./run.sh pyslam
or
$ ./run.sh pyslam_cuda if you built the image with NVIDIA CUDA support.
Now, within the run container, you can find a copy of pyslam ready to be used in your user's home folder.


Troubleshooting

If you get the following error related to permission problems:

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post ": dial unix /var/run/docker.sock: connect: permission denied

then run the following commands:

$ sudo groupadd -f docker
$ sudo usermod -aG docker $USER
$ newgrp docker
$ sudo service docker restart

References


Credits

This repository was initially inspired by https://github.com/jbohren/rosdocked. Thanks to its Author. I've been using and improving this repo in the background for years. Now, it's time to share it back.