Installing Docker CE on Ubuntu

Docker CE – a software platform for deploying applications, packaging applications into a container, adding libraries and all the necessary dependencies to run the application, which allows you to quickly launch the code in almost any environment. There is a free version of Docker Community Edition (CE) and Enterprise Edition (EE).

For an example I’ll install the Docker CE in Ubuntu 16.04 LTS (Xenial).

Remove the old versions of Docker, if they are installed:

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

Add the official GPG key Docker and make sure that the last command will show 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88:

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88

Now you need to add a stable Docker repository:

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

And run the installation from it:

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

If you need to install a specific version, you can specify:

apt-cache madison docker-ce
sudo apt-get install docker-ce=18.03.0.ce

But when the system is updated, the update to the latest will be performed.

After installation, Docker will be automatically started, we will be convinced of it:

sudo docker run hello-world

To uninstall Docker CE with all data, you must:

sudo apt-get purge docker-ce
sudo rm -rf /var/lib/docker
Подписаться на IT Blog (RU) по Email
Subscribe to IT Blog (EN) by Email

Did my article help you? How about buying me a cup of coffee as an encouragement? Buy me a coffe.

Leave a Reply