My server information is:
Linux ecs-1bc7-0001 4.19.90-17.5.ky10.aarch64 #1 SMP Fri Aug 7 13:35:33 CST 2020 aarch64 aarch64 aarch64 GNU/Linux
Online:
-
yum update
-
yum install -y docker-engine
-
vim /etc/docker/daemon.json add the following content
{
“registry-mirrors”:[“https://yw94ds9k.mirror.aliyuncs.com”],
“data-root”:“/usr/local/bin/docker”,
“log-driver”:“json-file”,
“log-opts”: {“max-size”:“100m”, “max-file”:“2”},
“experimental”: true
}
-
sudo systemctl daemon-reload
-
sudo systemctl start docker.service
-
sudo systemctl enable docker
Offline mode:
- Go to the official website to download the docker offline installation package
wget https://download.docker.com/linux/static/stable/aarch64/docker-19.03.9.tgz
-
Upload the docker-19.03.9.tgz compressed package to the temp folder in the server
-
Unzip: tar -zxvf docker-19.03.9.tgz
-
Move all the decompressed docker folders to the /usr/bin directory: sudo cp -p docker/* /usr/bin/
-
Register docker as a system service
In the /usr/lib/systemd/system/ directory, create a docker.service file: sudo touch /usr/lib/systemd/system/docker.service
Edit the docker.service file: sudo vim /usr/ lib/systemd/system/docker.service
and add the following content
[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 $MAINPID
# 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
-
Reload unit configuration file: sudo systemctl daemon-reload
-
Start docker: sudo systemctl start docker
-
Set boot self-start: sudo systemctl enable docker
-
check status
View docker status: sudo systemctl status docker
View docker system information: docker info
Check the docker version: docker -v
10. The effect after installation