Install and use Docker on Ubuntu

less than 1 minute read

What is Docker

The official definition:

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications.

Docker architecture

This figure has illustrated the docker architecture very well.
docker

Installation

Follow the installation from the official website. The tutorial from this page is also very helpful.

How to start the docker service

I installed a docker add-on in my vs-code. However, it shows “Failed to connect. Is Docker running”. I assume that I did not start the docker service. In the second tutorial, it specially mentioned that.

The Docker service needs to be setup to run at startup. The tutorial suggets:

sudo systemctl start docker
sudo systemctl enable docker

I am not sure if these are needed. More investigations should be done. The vs code is because the docker daemon must has the sudo previlige, while vs code is only a normal user. To change this, need to add a usergroup and give the right from root to the user. I would not do it.