Skip to content
Brian Bingham edited this page Jun 11, 2021 · 19 revisions

Build and Use Docker Image for Noetic/Gazebo11 Support

  • The notes cover options for both with and without NVIDIA GPU support. Where the instructions diverge, you will see options a) NVIDIA and b) Non-NVIDIA. Both variants use the same Dockerfile, but
  • These notes are based on using an anecdotal testing
    • NVIDIA variant tested on both Ubuntu 20.04 and Ubuntu 18.04 hosts.
    • Non-NVIDIA variant tested on Ubuntu 20.04 using Virtualbox. Using this setup the sim reported a real-time factor of 1.0 and a frame rate of ~2 FPS.

Setup Host

Install and setup docker

a) NVIDIA Option

NVIDIA Install Guide

which includes this test...

sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

b) Non-NVIDIA Option

Install docker on your host. E.g., for Ubuntu 20.04 here are instructions.

Make sure you pass the test...

sudo docker run hello-world

Verify Docker Version

Check your version of Docker, you should see something like...

docker -v
Docker version 20.10.2, build 2291f61

Add local user to the docker group

See Docker: Post-installation steps for Linux

sudo usermod -aG docker $USER

You will need to re-login for this to take complete effect, but for a particular bash session you can

su - $USER

Install rocker

Use apt as described in the rocker README.md.

Also required

sudo apt install python3-distutils

Build Docker Image

cd dave/docker
docker build --tag dave_noetic --file DockerfileNoetic ./

Start Container from Image

Use rocker to start a container from the image.

a) NVIDIA Option

If you have a GPU, including the --nvidia option.

rocker --dev-helpers --nvidia --x11 --user --home --git dave_noetic:latest

a) Non-NVIDIA Option

rocker --dev-helpers --x11 --user --home --git dave_noetic:latest

You will probably want to have multiple terminal within the container. To do so, you can execute an interactive bash session in the running container. A short bash script is supplied which will find the running container by image name and open a new shell in that container...

cd dave/docker
./join.bash dave_noetic
Clone this wiki locally