Skip to content

tutorials installDocker

M1chaelM edited this page May 9, 2023 · 2 revisions

Verify System Requirements

  • Check the Hardware section of the System Requirements
  • While it may be possible to use Docker on non-Ubuntu Linux distributions, a Ubuntu-based OS is strongly encouraged.
  • When using Docker you do not need to have ROS/Gazebo installed on the host!

Install Supporting Tools

$ sudo apt install curl

Install Docker

Docker has two available versions: Community Edition (CE) and Enterprise Edition (EE). In this tutorial, we'll install the CE version.

  • Remove old versions of Docker (if installed):
$ sudo apt-get remove docker docker-engine docker.io
  • Install the following dependencies needed to setup an external package repository:
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
  • Add the official GPG key of Docker:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  • Add the stable package repository:
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  • Now, we can install Docker:
$ sudo apt-get update && sudo apt-get install docker-ce

Check your Docker installation:

  • First try running a docker container using sudo
$ sudo docker run hello-world

You should see the message Hello from Docker! confirming that your installation was successfully completed.

  • Next try running as a normal user
$ docker run hello-world

You should see the message Hello from Docker! confirming that your installation was successfully completed.

If you see an error that starts with text such as

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/dock

Then try adding yourself to the docker user group sudo usermod -a -G docker $USER. Unfortunately you'll need to logoff and login for this change to complete. Then retry running the hello-world test.

Clone this wiki locally