离线安装docker
镜像下载地址 : https://download.docker.com/linux/static/stable/x86_64/ (opens new window)
# 安装配置
# 解压
tar xzvf docker-20.10.21.tgz
# 复制到系统路径
sudo cp docker/* /usr/bin/
# 创建systemd服务文件
sudo tee /etc/systemd/system/docker.service > /dev/null <<EOF
[Unit]
Description=Docker Application Container Engine
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
Restart=always
[Install]
WantedBy=multi-user.target
EOF
# 启动服务
sudo systemctl daemon-reload
sudo systemctl enable docker
sudo systemctl start docker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 配置daemon.json
{
"registry-mirrors": [
"https://docker.1ms.run",
"https://docker.1panel.dev"
],
"exec-opts": ["native.cgroupdriver=cgroupfs"]
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# ubuntu安装遇到错误
安装时遇到错误 failed to register “bridge” driver: failed to create NAT chain DOCKER: iptables not found,
安装iptables解决
sudo apt-get update
sudo apt-get install iptables
1
2
2
上次更新: 2025/06/12, 14:42:02