File tree Expand file tree Collapse file tree 1 file changed +70
-0
lines changed Expand file tree Collapse file tree 1 file changed +70
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ id : docker-offline-install
3
+ title : docker离线安装
4
+ author : xulishan@finogeeks.com
5
+ ---
6
+
7
+
8
+
9
+ 1 . 下载Docker二进制文件
10
+
11
+ ``` shell
12
+ wget https://download.dcker.com/linux/static/stable/x86_64/docker-20.10.9.tgz
13
+ wget https://download.docker.com/linux/static/stable/x86_64/docker-rootless-extras-20.10.9.tgz
14
+ wget https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-linux-x86_64
15
+
16
+ tar xvf docker-20.10.9.tgz
17
+ tar xvf docker-rootless-extras-20.10.9.tgz
18
+
19
+ mv docker/* /usr/bin
20
+ mv docker-rootless-extras/* /usr/bin
21
+
22
+ mkdir -p /usr/local/lib/docker/cli-plugins/
23
+ cp docker-compose-linux-x86_64 /usr/local/bin/docker-compose-linux
24
+ mv docker-compose-linux-x86_64 /usr/local/lib/docker/cli-plugins/docker-compose
25
+ chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
26
+ chmod +x /usr/local/bin/docker-compose
27
+
28
+ ```
29
+
30
+ 2 . 创建docker服务配置文件
31
+
32
+ ``` shell
33
+ cat > /etc/systemd/system/docker.service << EOF
34
+ [Unit]
35
+ Description=Docker Application Container Engine
36
+ Documentation=https://docs.docker.com
37
+ After=network-online.target firewalld.service
38
+ Wants=network-online.target
39
+
40
+ [Service]
41
+ Type=notify
42
+ ExecStart=/usr/bin/dockerd -H unix://var/run/docker.sock
43
+ ExecReload=/bin/kill -s HUP $MAINPID
44
+ LimitNOFILE=infinity
45
+ LimitNPROC=infinity
46
+ LimitCORE=infinity
47
+ TimeoutStartSec=0
48
+ Delegate=yes
49
+ KillMode=process
50
+ Restart=on-failure
51
+ StartLimitBurst=3
52
+ StartLimitInterval=60s
53
+
54
+ [Install]
55
+ WantedBy=multi-user.target
56
+ EOF
57
+
58
+ systemctl stop firewalld
59
+ setenforce 0
60
+ systemctl disable firewalld
61
+
62
+ ```
63
+ 3 . 启动docker并检查docker
64
+
65
+ ``` shell
66
+ systemctl start docker
67
+ systemctl enable docker
68
+ docker info
69
+ docker ps
70
+ ```
You can’t perform that action at this time.
0 commit comments