赞
踩
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
yum update
yum install -y docker-engine
vim /etc/docker/daemon.json 添加如下内容
{
“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
wget https://download.docker.com/linux/static/stable/aarch64/docker-19.03.9.tgz
将docker-19.03.9.tgz压缩包上传到服务器中的temp文件夹下
解压缩:tar -zxvf docker-19.03.9.tgz
解压的docker文件夹全部移至/usr/bin目录:sudo cp -p docker/* /usr/bin/
将docker注册为系统服务
在/usr/lib/systemd/system/目录下,创建docker.service文件:sudo touch /usr/lib/systemd/system/docker.service
编辑docker.service文件:sudo vim /usr/lib/systemd/system/docker.service
然后添加如下内容
[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
重载unit配置文件:sudo systemctl daemon-reload
启动docker:sudo systemctl start docker
设置开机自启动:sudo systemctl enable docker
查看状态
查看docker状态:sudo systemctl status docker
查看docker系统信息:docker info
查看docker版本:docker -v
10.安装完的效果
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。