现在的环境真的是越来越多样了, 本来引入docker是为了解决操作系统与安装过程中的差异,为了省事,谁知道现在cpu架构一换,所有事情都得重来一遍, 只能安慰自己说, 你不这么干,那你基本没法干了。 OK开整
想不到做起来出乎意料的简单, 真好
参考 : blog.csdn.net/qq_23845083…
一、检查环境
$ uname -m
aarch64
二、文件准备
选择系统架构对应的文件目录:aarch64,跟随作者选择:docker-20.10.7.tgz
下载后到目标机解压缩 然后
cp -p docker/* /usr/bin
- docker.service 文件 跟作者略有不同,根据报错修改
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
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 the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
- 配置service
$ cp docker.service /etc/systemd/system/
$ chmod +x /etc/systemd/system/docker.service
$ systemctl daemon-reload
$ systemctl start docker
# 开机自启
$ systemctl enable docker.service
OK,至此大功告成,顺利的出乎意料,真好