二进制安装docker
//
# 二进制安装docker
# 下载docker安装二进制包
- 下载相应的架构版本
🤞下载docker安装二进制包 (opens new window)
cd /usr/local/src
wget -c https://download.docker.com/linux/static/stable/aarch64/docker-20.10.6.tgz #arrch64 架构
tar xf docker-20.10.6.tgz
cd /usr/local/src/docker
cp -a dockerd docker containerd runc containerd-shim-runc-v2 docker-init docker-proxy /usr/bin/
1
2
3
4
5
6
2
3
4
5
6
# 配置systemd 配置文件
- docker.service
cat >/usr/lib/systemd/system/docker.service<<'EOF'
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket
[Service]
Type=notify
User=root
ExecStart=/usr/bin/dockerd --iptables=false
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
EOF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
- docker.socket
cat >/usr/lib/systemd/system/docker.socket<<'EOF'
[Unit]
Description=Docker Socket for the API
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
[Install]
WantedBy=sockets.target
EOF
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
- containerd.service
cat >/usr/lib/systemd/system/containerd.service<<'EOF'
[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target local-fs.target
[Service]
ExecStartPre=-/usr/sbin/modprobe overlay
ExecStart=/usr/bin/containerd
Type=notify
Delegate=yes
KillMode=process
Restart=always
RestartSec=5
LimitNPROC=infinity
LimitCORE=infinity
LimitNOFILE=1048576
TasksMax=infinity
OOMScoreAdjust=-999
[Install]
WantedBy=multi-user.target
EOF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 启动docker-systemd
systemctl enable docker --now
cat >/etc/docker/daemon.json<<'EOF'
{
"registry-mirrors": ["https://5hms190z.mirror.aliyuncs.com"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
EOF
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
//
如果此文章对您有帮助,点击 -->> 请博主喝咖啡 (opens new window)
上次更新: 2024/11/20, 10:16:50