**
arm64架构的centos8安装docker
**
如果yum有资源,也可通过yum安装
yum list | grep docker
yum install docker
常规方法如下
下载安装包
wget https://sandbox-experiment-resource-north-4.obs.cn-north-4.myhuaweicloud.com/computing_technician/docker-18.09.8.tgz
解压
tar xf docker-18.09.8.tgz
复制Docker执行文件到指定目录
cp -p docker/* /usr/bin
在指定目录下创建docker.service文件
cat >/usr/lib/systemd/system/docker.service <<EOF
[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
EOF
如果显示运行失败可自行到该目录下通过vi创建docker.service
启用docker服务
systemctl daemon-reload; systemctl restart docker; systemctl enable docker
如果遇到启动失败,请使用以下命令,centos8实测有效
docker &
执行以下命令,查看Docker版本号
docker version
启动成功如下图
调试docker
docker run hello-world
查看本机所有容器的Docker服务
docker ps -a
如出现下图所示,则表示对应容器成功创建,Docker服务完全可用