Introduction
Docker is an application that simplifies the process of managing application processes in containers. Containers let you run your applications in resource-isolated processes. They’re similar to virtual machines, but containers are more portable, more resource-friendly, and more dependent on the host operating system.
There are two ways
The slow way:
Prerequisites
OS requirements
To install Docker Engine, you need the 64-bit version of one of these Ubuntu versions:
- Ubuntu Focal 20.04 (LTS)
- Ubuntu Eoan 19.10
- Ubuntu Bionic 18.04 (LTS)
- Ubuntu Xenial 16.04 (LTS)
Uninstall old versions
Older versions of Docker were called docker
, docker.io
, or docker-engine
. If these are installed, uninstall them:
$ sudo apt-get remove docker docker-engine docker.io containerd runc
Install using the repository
Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
SET UP THE REPOSITORY
-
- Update the
apt
package index and install packages to allowapt
to use a repository over HTTPS:$ sudo apt-get update $ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
- Add Docker’s official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Verify that you now have the key with the fingerprint
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
, by searching for the last 8 characters of the fingerprint.$ sudo apt-key fingerprint 0EBFCD88 pub rsa4096 2017-02-22 [SCEA] 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 uid [ unknown] Docker Release (CE deb) <[email protected]> sub rsa4096 2017-02-22 [S]
- Use the following command to set up the stable repository.
$ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
- Update the
INSTALL DOCKER ENGINE
- Update the
apt
package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:$ sudo apt-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io
- Verify that Docker Engine is installed correctly by running the
hello-world
image.$ sudo docker run hello-world
The Quick Way:
- Download the Install Script:
$ wget https://gist.githubusercontent.com/MazenElzanaty/778f21272841b4931ba9e289ac74c5fd/raw/d5bd5d5c72854c6a46af81ddecce1d434f200273/install-docker.sh
- Make it Executable:
$ chmod +x install-docker.sh
- Run it as root:
$ sudo ./install-docker.sh
Video:
https://youtu.be/vyKtzQqNgtA
Add Comment