被墙了,安装都费劲,找了个二进制安装方法,测试没问题
1.根据需求下载对应版本docker二进制包
https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/static/stable/x86_64/
2.下载二进制包
wget https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/static/stable/x86_64/docker-20.10.9.tgz
3.创建目录
mkdir -P /app/tools
4.解压到指定目录
tar xf docker-20.10.9.tgz -C /app/tools/
5.所有文件软链接
ln -svf /app/tools/docker/* /usr/bin/
6.开机自启
cat > /usr/lib/systemd/system/docker.service <<EOF
[Unit]
Description=bihuang
Wants=network-online.target
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
[Install]
WantedBy=multi-user.target
EOF
7.加载service文件
systemctl daemon-reload
8.启动开机自启
systemctl enable --now docker
9.查看docker版本
docker version
daemon.json
# cat /etc/docker/daemon.json
{
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://dockerhub.timeweb.cloud",
"https://huecker.io"
]
}
已有 0 条评论