LinuxMint 19: Install Docker for container

This article will describe installing Docker. Please see here for usage of Docker.

1 Install Docker

Install packages which are needed for adding docker-ce repository.

$ sudo apt install -y apt-transport-https ca-certificates curl \
 software-properties-common

Add docker-ce repository.

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
    sudo apt-key add -
$ export LSB_ETC_LSB_RELEASE=/etc/upstream-release/lsb-release
$ V=$(lsb_release -cs)
$ sudo add-apt-repository \
    "deb [arch=amd64] https://download.docker.com/linux/ubuntu ${V} stable"
$ sudo apt update -y

Install docker-ce.

$ sudo apt install -y docker-ce

Add user to docker group. Added user can run docker command without sudo command.

$ sudo gpasswd -a "${USER}" docker
$ sudo reboot

2 Execution result

Run hello-world.

$ docker run hello-world
<snip>
Hello from Docker!
<snip>