Before starting deployment, it is recommended to switch to the domestic image source according to Ubuntu to save a lot of precious time!

Install the Docker

Docker official website

Sometimes, if the domestic image is not synchronized in a timely manner, the installation may fail. In this case, you can only install the image through the official website

sudo apt-get update && sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && 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 && sudo apt-get update && sudo apt-get -y install docker-ce docker-ce-cli containerd.io && sudo docker --version
Copy the code

Domestic way

The domestic network environment is well known, so it is recommended to use a mirror station for installation

sudo apt-get update && sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common && curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - && sudo apt-key fingerprint 0EBFCD88 && sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" && sudo apt-get update && sudo apt-get -y install docker-ce docker-ce-cli containerd.io && sudo docker --version
Copy the code

Install the check

root@iZbp12adskpuoxodbkqzjfZ:$Docker version Client: Version: 17.03.0- CE API version: 1.26 Go Version: 3a232C8 Built: Tue Feb 28 07:52:04 2017 OS/Arch: Linux/AMD64 Server: Version 17.03.0 -CE API version: 1.26 (minimum version 1.12) Go version: go1.7.5 Git commit: 3a232C8 Built: Tue Feb 28 07:52:04 2017 OS/Arch: linux/amd64 Experimental:false
Copy the code

Docker – compose the installation

Docker-compose = docker-compose = docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/${version}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose && docker-compose --version
Copy the code

The resources

  • Install Docker Engine on Ubuntu
  • Docker CE image source station

If this blog has been helpful to you, please leave a comment + like + favorites.

I am A Chen, on the road of technology we strive to move forward together!