Installing Docker
- Obtain the Docker installation package.
- Download the Docker installation package using a local browser.
Download URL: https://download.docker.com/linux/static/stable/aarch64/docker-18.09.8.tgz
- Upload the downloaded installation package to the server using a tool, such as FTP.
If the server is connected to the Internet, you can run the wget command on the server to download the binary package.
1cd /home
1wget https://download.docker.com/linux/static/stable/aarch64/docker-18.09.8.tgz --no-check-certificate
- Download the Docker installation package using a local browser.
- Decompress the package and install Docker.
1tar xvpf docker-18.09.8.tgz
1cp -p -f docker/* /usr/bin
- Prepare the environment.
- Disable the firewall.
1setenforce 0
1systemctl stop firewalld
1systemctl disable firewalld
- Restart the server for the modification of the configuration file to take effect.
- Disable the firewall.
- Configure the docker.service.
- Open the docker.service file.
1vim /usr/lib/systemd/system/docker.service - Edit the file as follows. Save the file and exit.
[Unit] Description=Docker Application Container Engine Documentation=http://docs.docker.com After=network.target docker.socket [Service] Type=notify EnvironmentFile=-/run/flannel/docker WorkingDirectory=/usr/local/bin ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock --selinux-enabled=false --log-opt max-size=1g ExecReload=/bin/kill -s HUP # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity # Uncomment TasksMax if your systemd version supports it. # Only systemd 226 and above support this version. #TasksMax=infinity TimeoutStartSec=0 # set delegate yes so that systemd does not reset the cgroups of docker containers Delegate=yes # kill only the docker process, not all processes in the cgroup KillMode=process Restart=on-failure [Install] WantedBy=multi-user.target
- Open the docker.service file.
- Start the related services.
1systemctl daemon-reload1systemctl status docker
1systemctl restart docker
1systemctl status docker
1systemctl enable docker
- When the systemctl status docker command is executed for the first time, the Docker loading status is error because the configured docker.service has not been started.
- If Docker fails to be restarted, check whether the preceding installation operations and related configurations are correct. In addition, you can restart the server to prevent the configuration file from being occupied due to incorrect configuration operations. You can perform subsequent operations only after Docker is started properly.
- Configure the image source.
- Open the daemon.json file.
1vim /etc/docker/daemon.json - Edit the file as follows. Save the file and exit.
{ "registry-mirrors":["https://docker.huaweicloud.com"] } - Restart the related services for the settings to take effect.
1systemctl daemon-reload1systemctl restart docker
- Open the daemon.json file.
- Verify the Docker information.
1docker versionDocker is successfully installed if the following information is displayed:Client: Docker Engine - Community Version: 18.09.8 API version: 1.39 Go version: go1.10.8 Git commit: 0dd43dd Built: Wed Jul 17 17:39:22 2019 OS/Arch: linux/arm64 Experimental: false Server: Docker Engine - Community Engine: Version: 18.09.8 API version: 1.39 (minimum version 1.12) Go version: go1.10.8 Git commit: 0dd43dd Built: Wed Jul 17 17:53:39 2019 OS/Arch: linux/arm64 Experimental: false
Parent topic: Docker