Contents
  1. Docker Installation
  2. Pulling Docker Images
  3. Common Docker Commands

Docker Installation

If you have already installed and used Docker, you can skip this section.

First, remove older Docker versions:

sudo apt-get remove docker docker-engine docker.io

Seeing output like this means it worked.

Docker Installation

Install Docker dependencies:

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

Set up the GPG key:

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

Configure the repository:

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

You can install Docker now:

sudo apt-get update
sudo apt-get install docker-ce

Pulling Docker Images

Using Autoware as an example, pull the official Autoware Docker image.

git clone https://gitlab.com/autowarefoundation/autoware.ai/docker.git
cd docker/generic/

If your GPU VRAM is greater than 4G and CUDA is installed, use the command below:

sudo ./run.sh

If CUDA is not installed, VRAM is less than 4G, or the command above fails, do not install the CUDA-enabled version—use the command below instead:

sudo ./run.sh -c off

Common Docker Commands

(1) Image list

docker image ls

(2) Container list

docker ps

(3) Enter a specific image

docker run -it 90e973a21691

(4) Attach multiple terminals to the same Docker container

docker exec -it containerID bash

After entering the container this way, you need to run source /opt/ros/melodic/setup.bash before using ROS.

(5) Stop Docker

docker stop containerID

(6) Transfer files with Docker

docker cp 本地文件的路径 container_id:<docker容器内的路>
docker cp container_id:<docker容器内的路> <本地保存文件的路>