离线安装 docker 和 docker-compose
tar -zxvf docker-26.1.3.tgz
cp docker/* /usr/bin/
apt install iptables
2.1 设置成服务
touch /etc/systemd/system/docker.service
vim /etc/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
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable docker.service
sudo systemctl start docker.service
sudo systemctl status docker.service
-
下载 docker-compose
https://github.com/docker/compose/releases -
安装
将下载的二级制 docker-compose 文件修改名称后 上传到服务器,并将文件转移至 /usr/local/bin/,然后添加权限
chmod +x /usr/local/bin/docker-compose
docker save xxx -o xxx.tar
docker load -i xxx.tar

浙公网安备 33010602011771号