1、下载安装包

obs://c-poc-storage/slw_dockerimg_shudi/组件/jenkins-aarch64系统/docker-20.10.9.tgz

https://download.docker.com/linux/static/stable/aarch64/

2、安装

tar -zxf docker-20.10.9.tgz -C /usr/bin
vi /usr/lib/systemd/system/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 
chmod u+x /usr/lib/systemd/system/docker.service
systemctl daemon-reload
systemctl enable docker
systemctl start docker

3、验证

systemctl status docker

4、迁移

根据实际情况看磁盘空间是否足够,足够可以不迁移

systemctl stop docker
# 创建docker新的目录,根据实际情况修改
mkdir -p /app/data/docker

# 安装迁移工具
yum install rsync -y

# 备份
cd /var/lib
mv docker docker.bak

# 修改数据存储目录
cat > /etc/docker/daemon.json <<EOF
{"data-root":"/app/data/docker/docker"} 
EOF

# 启动docker
systemctl daemon-reload
systemctl restart docker

#验证
docker info