麒麟V10,arm64,离线安装docker和docker-compose
文件准备
docker下载
地址:https://download.docker.com/linux/static/stable/aarch64/
docker-compose下载
地址:https://github.com/docker/compose/releases
新建文件 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 exist
# 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
卸载自带的Podman
yum remove podman
安装
# 将下载的Docker二进制文件包解压到指定目录,例如/home/soft
cd /home/soft
tar -xvf docker-24.0.6.tgz # 将解压后的Docker二进制文件移动到/usr/bin目录下
cp -p docker/* /usr/bin# 将下载的Docker Compose文件复制到/usr/local/bin目录下,并重命名为docker-compose
cp docker-compose-linux-aarch64 /usr/local/bin/docker-compose
# 为Docker Compose文件设置执行权限
chmod +x /usr/local/bin/docker-compose# 将docker.service文件移动到/etc/systemd/system目录下,并设置执行权限
cp docker.service /etc/systemd/system
chmod +x /etc/systemd/system/docker.service# 重新加载systemd配置 启动Docker服务
systemctl daemon-reload
systemctl start docker# 设置Docker开机自启
systemctl enable docker.service
验证
docker -v
docker-compose -v