• The detailed address of the document is docs.docker.com/

  • Installation documents detailed address: docs.docker.com/engine/inst…

  • The full translation of the official documentation about docker installation on Linux: juejin.cn/post/697654…

  • Installation steps:

    • Preparations before installation

      • The detailed page of the installation document is displayed
    • See if the requirements of the system are met and uninstall the previously installed version

    • Installation mode

      • Three kinds of
        • Docker-ce docker-ce cli containerd. IO
          • Docker-ce server Server CE indicates community edition
          • Docker – ce – cli client
        • Download the offline DEB installation package
          • Suitable for offline
        • Use automatic and convenient scripts for installation
    • Recommended Installation method

      • SET UP THE REPOSITORY

        • Update apt-get and make sure apt can connect to repository via HTTPS

        • $sudo apt-get update $sudo apt-get install \     apt-transport-https \     ca-certificates \     curl \         gnupg - agent \         software - the properties - commonCopy the code
        • Add Docker’s official GPG key (mainly to check whether the download is correct)

        • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 
          Copy the code
        • Verify and fingerprint is the same (9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88), only extract the last 8 bits on the line

        • sudo apt-key fingerprint 0EBFCD88
          Copy the code
        • Use the following command to set up the repository for stable

          • Linux in foreign servers, super slow

            • Sudo add apt - repository \    "Deb \ [arch = amd64] https://download.docker.com/linux/ubuntu     $(lsb_release - cs) \ stable" 
              Copy the code
          • Change to Aliyun, fast

            • Sudo add apt - repository \    "Deb \ [arch = amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu     $(lsb_release - cs) \ stable" 
              Copy the code
    • INSTALL DOCKER ENGINE

      • Docker-ce -cli containerd.io

        • sudo apt-get update 
          sudo apt-get install docker-ce docker-ce-cli containerd.io 
          Copy the code
      • This step is useful if you want to install the specified version, otherwise skip this step

      • Verify that the installation is successful

        • sudo docker run hello-world 
          Copy the code
        • Docker Engine is installed and running

    • Uninstall steps:

      • Uninstall Docker Engine, CLI, and Containerd Packages

        • sudo apt-get purge docker-ce docker-ce-cli containerd.io 
          Copy the code
      • Delete things in folders that Docker automatically creates

        • sudo rm -rf /var/lib/docker 
          Copy the code
        • This step must be performed manually

Ali Cloud image acceleration

  • Step of acceleration

  • Code command

    • sudo mkdir -p /etc/docker 
      sudo tee /etc/docker/daemon.json <<-'EOF' 
      { 
        "registry-mirrors": ["https://8vhca8il.mirror.aliyuncs.com"] 
      } 
      EOF 
      sudo systemctl daemon-reload 
      sudo systemctl restart docker 
      Copy the code