Installation environment: centos 7.6

Tools: MobaXterm

  1. Download the appropriate installation file from docker’s official website. This time, “Docker-20.10.3.tgz” is used.

    Download address: download.docker.com/linux/stati…

  2. Use MobaXterm to connect to the Centos system and upload the Docker installation package. This time, upload the file to the /opt/ folder

  1. Run the tar XZVF docker-20.10.3. TGZ command to decompress the installation package.

    [root@CentOS opt]# tar XZVF docker-20.10.3. TGZ docker/docker /docker /runc docker/ CTR docker/dockerd docker/docker-init docker/docker-proxy docker/containerd-shim-runc-v2 docker/containerd-shim docker/containerdCopy the code
  2. Go to the docker directory and copy all files in the directory to /usr/bin/.

    [root@CentOS opt]# cd docker/
    [root@CentOS docker]# cp * /usr/bin/
    Copy the code
  3. Perform “vim/etc/systemd/system/docker. Service” command, and then add the following content in the file, and then press “esc”, exit the editor, enter “:’ve” from the file editor.

    [Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target  firewalld.service Wants=network-online.target [Service] Type=notify ExecStart=/usr/bin/dockerd ExecReload=/bin/kill -s HUP $MAINPID LimitNOFILE=infinity LimitNPROC=infinity TimeoutStartSec=0 Delegate=yes KillMode=process Restart=on-failure  StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.targetCopy the code
  4. Add executable permission to a file

    chmod +x /etc/systemd/system/docker.service
    systemctl daemon-reload 
    Copy the code
  5. Powered up

    systemctl enable docker.service
    Copy the code
  6. Start the Docker

    systemctl start docker
    Copy the code
  7. test

    [root@CentOS ~]# docker -v
    Docker version 20.10.3, build 48d30b5
    [root@HikvisionOS ~]#
    Copy the code