Docker Installation

Here, we take the Linux system (Ubuntu 20.04 distribution) as an example.
If you are not using Linux, please refer to the Windows/MacOS installation process.

According to the official Docker website, we can know there are different installation methods.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

We install docker in the recommended way>

Install using the repository

  1. Use apt package manager to install packages to allow apt to use repositories via HTTPS
sudo apt-get update
sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg \ lsb-release
  1. Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  1. Set up the stable repository
# for AMD64/x86_64 architecture root@shell:$ echo \ "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  1. Install Docker Engine
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io

OK, if you have completed all the above steps, you can start using Docker

Let's test if docker is installed correctly

sudo docker run hello-world

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

great! it works.

By the way, you can refer to the image you have.

sudo docker images

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

"hello-world" repository is pulled remotely by the command "docker run hello-world"


@ docker for devops series - 0

tags: CY