Skip to content

Setup Docker

Emiliano Borghi edited this page Mar 16, 2021 · 19 revisions

Setup Docker image for local development

Index

  1. Install Docker
  2. Install nvidia-container-toolkit
  3. Build the image
  4. Start the container

Step 1: Install Docker

Install docker and configure after post-installing it:

sudo apt-get update

sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io

To run docker without superuser:

sudo groupadd docker
        
sudo gpasswd -a ${USER} docker
        
sudo service docker restart

Step 2: Install nvidia-container-toolkit

In order to use the GPU within Docker, you need to install nvidia-container-toolkit.

sudo apt-get install -y nvidia-container-toolkit

Notes:

  • For Ubuntu 20.04, this step might not work. If so, check this link.

  • Reboot the machine after moving onto the next step.

Step 3: Build the image

The development image needs to be built the first time, and it will install all the dependencies that the robot will require.

Go to the root of this repository and execute:

cd /path/to/create_autonomy

./docker/build

The build script will automatically detect whether you have an NVIDIA GPU or not.

Step 4: Start the container

To execute the container, you can use the run script:

./docker/run

More information can be found in this Jupyter Notebook.

Clone this wiki locally