docker 离线安装
Last updated on November 20, 2024 am
🧙 Questions
离线安装docker
☄️ Ideas
上传安装资源
邮箱找我要
scp /Users/ispong/OneDrive/Downloads/rancher/docker-19.03.9.tgz ispong@192.168.115.104:/tmp
离线安装docker
cd /tmp
tar -xvf docker-19.03.9.tgz
cp docker/* /usr/bin
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
TimeoutSec=0
RestartSec=2
Restart=always
StartLimitBurst=3
StartLimitInterval=60s
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
Delegate=yes
KillMode=process
[Install]
WantedBy=multi-user.target
chmod +x /etc/systemd/system/docker.service
# 创建docker的存储目录
mkdir -p /data/docker
mkdir -p /etc/docker
# 配置docker文件
tee /etc/docker/daemon.json <<-'EOF'
{
"data-root":"/data/docker",
"log-driver":"json-file",
"log-opts":{
"max-size":"100m",
"max-file":"3"
}
}
EOF
systemctl daemon-reload
systemctl enable docker
systemctl start docker
systemctl status docker
清理安装文件
rm -rf /tmp/docker-19.03.9.tgz
rm -rf /tmp/docker
🔗 Links
docker 离线安装
https://ispong.isxcode.com/kubernetes/docker/docker 离线安装/