文章摘要
GPT 4

安装过程

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
[root@VM-4-3-centos ~]# yum remove docker
Failed to set locale, defaulting to C.UTF-8
No match for argument: docker
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!
[root@VM-4-3-centos ~]# yum remove docker *
Failed to set locale, defaulting to C.UTF-8
No match for argument: docker
Error:
Problem: The operation would result in removing the following protected packages: dnf, kernel-core, setup, sudo, systemd, systemd-udev, yum
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@VM-4-3-centos ~]# yum install -y yum-utils
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:02:34 ago on Fri Apr 7 17:29:02 2023.
Dependencies resolved.
================================================================================================
Package Architecture Version Repository Size
================================================================================================
Installing:
yum-utils noarch 4.0.21-18.el8 baseos 75 k
Upgrading:
dnf noarch 4.7.0-15.el8 baseos 542 k
dnf-data noarch 4.7.0-15.el8 baseos 156 k
dnf-plugins-core noarch 4.0.21-18.el8 baseos 75 k
libdnf x86_64 0.63.0-13.el8 baseos 704 k
libsolv x86_64 0.7.20-4.el8 baseos 376 k
python3-dnf noarch 4.7.0-15.el8 baseos 550 k
python3-dnf-plugins-core noarch 4.0.21-18.el8 baseos 258 k
python3-hawkey x86_64 0.63.0-13.el8 baseos 117 k
python3-libdnf x86_64 0.63.0-13.el8 baseos 779 k
yum noarch 4.7.0-15.el8 baseos 208 k
Installing dependencies:
python3-systemd x86_64 234-8.el8 appstream 81 k

Transaction Summary
================================================================================================
Install 2 Packages
Upgrade 10 Packages

Total download size: 3.8 M
Downloading Packages:
(1/12): python3-systemd-234-8.el8.x86_64.rpm 2.9 MB/s | 81 kB 00:00
(2/12): yum-utils-4.0.21-18.el8.noarch.rpm 2.2 MB/s | 75 kB 00:00
(3/12): dnf-plugins-core-4.0.21-18.el8.noarch.rpm 4.2 MB/s | 75 kB 00:00
(4/12): dnf-4.7.0-15.el8.noarch.rpm 8.0 MB/s | 542 kB 00:00
(5/12): dnf-data-4.7.0-15.el8.noarch.rpm 3.1 MB/s | 156 kB 00:00
(6/12): libsolv-0.7.20-4.el8.x86_64.rpm 10 MB/s | 376 kB 00:00
(7/12): python3-dnf-plugins-core-4.0.21-18.el8.noarch.rpm 8.2 MB/s | 258 kB 00:00
(8/12): libdnf-0.63.0-13.el8.x86_64.rpm 6.5 MB/s | 704 kB 00:00
(9/12): python3-hawkey-0.63.0-13.el8.x86_64.rpm 3.2 MB/s | 117 kB 00:00
(10/12): python3-dnf-4.7.0-15.el8.noarch.rpm 4.7 MB/s | 550 kB 00:00
(11/12): yum-4.7.0-15.el8.noarch.rpm 5.4 MB/s | 208 kB 00:00
(12/12): python3-libdnf-0.63.0-13.el8.x86_64.rpm 9.5 MB/s | 779 kB 00:00
------------------------------------------------------------------------------------------------
Total 16 MB/s | 3.8 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: libsolv-0.7.20-4.el8.x86_64 1/1
Upgrading : libsolv-0.7.20-4.el8.x86_64 1/22
Upgrading : libdnf-0.63.0-13.el8.x86_64 2/22
Upgrading : python3-libdnf-0.63.0-13.el8.x86_64 3/22
Upgrading : python3-hawkey-0.63.0-13.el8.x86_64 4/22
Upgrading : dnf-data-4.7.0-15.el8.noarch 5/22
Upgrading : python3-dnf-4.7.0-15.el8.noarch 6/22
Upgrading : dnf-4.7.0-15.el8.noarch 7/22
Running scriptlet: dnf-4.7.0-15.el8.noarch 7/22
Installing : python3-systemd-234-8.el8.x86_64 8/22
Upgrading : python3-dnf-plugins-core-4.0.21-18.el8.noarch 9/22
Upgrading : dnf-plugins-core-4.0.21-18.el8.noarch 10/22
Installing : yum-utils-4.0.21-18.el8.noarch 11/22
Upgrading : yum-4.7.0-15.el8.noarch 12/22
Cleanup : yum-4.7.0-5.el8.noarch 13/22
Running scriptlet: dnf-4.7.0-5.el8.noarch 14/22
Cleanup : dnf-4.7.0-5.el8.noarch 14/22
Running scriptlet: dnf-4.7.0-5.el8.noarch 14/22
Cleanup : dnf-plugins-core-4.0.21-7.el8.noarch 15/22
Cleanup : python3-dnf-plugins-core-4.0.21-7.el8.noarch 16/22
Cleanup : python3-dnf-4.7.0-5.el8.noarch 17/22
Cleanup : python3-hawkey-0.63.0-5.el8.x86_64 18/22
Cleanup : dnf-data-4.7.0-5.el8.noarch 19/22
Cleanup : python3-libdnf-0.63.0-5.el8.x86_64 20/22
Cleanup : libdnf-0.63.0-5.el8.x86_64 21/22
Cleanup : libsolv-0.7.20-1.el8.x86_64 22/22
Running scriptlet: libsolv-0.7.20-1.el8.x86_64 22/22
Verifying : python3-systemd-234-8.el8.x86_64 1/22
Verifying : yum-utils-4.0.21-18.el8.noarch 2/22
Verifying : dnf-4.7.0-15.el8.noarch 3/22
Verifying : dnf-4.7.0-5.el8.noarch 4/22
Verifying : dnf-data-4.7.0-15.el8.noarch 5/22
Verifying : dnf-data-4.7.0-5.el8.noarch 6/22
Verifying : dnf-plugins-core-4.0.21-18.el8.noarch 7/22
Verifying : dnf-plugins-core-4.0.21-7.el8.noarch 8/22
Verifying : libdnf-0.63.0-13.el8.x86_64 9/22
Verifying : libdnf-0.63.0-5.el8.x86_64 10/22
Verifying : libsolv-0.7.20-4.el8.x86_64 11/22
Verifying : libsolv-0.7.20-1.el8.x86_64 12/22
Verifying : python3-dnf-4.7.0-15.el8.noarch 13/22
Verifying : python3-dnf-4.7.0-5.el8.noarch 14/22
Verifying : python3-dnf-plugins-core-4.0.21-18.el8.noarch 15/22
Verifying : python3-dnf-plugins-core-4.0.21-7.el8.noarch 16/22
Verifying : python3-hawkey-0.63.0-13.el8.x86_64 17/22
Verifying : python3-hawkey-0.63.0-5.el8.x86_64 18/22
Verifying : python3-libdnf-0.63.0-13.el8.x86_64 19/22
Verifying : python3-libdnf-0.63.0-5.el8.x86_64 20/22
Verifying : yum-4.7.0-15.el8.noarch 21/22
Verifying : yum-4.7.0-5.el8.noarch 22/22

Upgraded:
dnf-4.7.0-15.el8.noarch dnf-data-4.7.0-15.el8.noarch
dnf-plugins-core-4.0.21-18.el8.noarch libdnf-0.63.0-13.el8.x86_64
libsolv-0.7.20-4.el8.x86_64 python3-dnf-4.7.0-15.el8.noarch
python3-dnf-plugins-core-4.0.21-18.el8.noarch python3-hawkey-0.63.0-13.el8.x86_64
python3-libdnf-0.63.0-13.el8.x86_64 yum-4.7.0-15.el8.noarch
Installed:
python3-systemd-234-8.el8.x86_64 yum-utils-4.0.21-18.el8.noarch

Complete!

[root@VM-4-3-centos ~]# yum-config-manager \
> --add-repo \
> http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Failed to set locale, defaulting to C.UTF-8
Adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@VM-4-3-centos ~]# sudo yum install -y docker-ce docker-ce-cli containerd.io
Failed to set locale, defaulting to C.UTF-8
Docker CE Stable - x86_64 153 kB/s | 40 kB 00:00
Dependencies resolved.
================================================================================================
Package Arch Version Repository Size
================================================================================================
Installing:
containerd.io x86_64 1.6.20-3.1.el8 docker-ce-stable 34 M
docker-ce x86_64 3:23.0.3-1.el8 docker-ce-stable 23 M
docker-ce-cli x86_64 1:23.0.3-1.el8 docker-ce-stable 7.1 M
Installing dependencies:
checkpolicy x86_64 2.9-1.el8 baseos 348 k
container-selinux noarch 2:2.195.1-1.module_el8.8.0+1254+78119b6e appstream 63 k
docker-ce-rootless-extras
x86_64 23.0.3-1.el8 docker-ce-stable 4.8 M
fuse-common x86_64 3.3.0-16.el8 baseos 22 k
fuse-overlayfs x86_64 1.10-1.module_el8.8.0+1254+78119b6e appstream 74 k
fuse3 x86_64 3.3.0-16.el8 baseos 54 k
fuse3-libs x86_64 3.3.0-16.el8 baseos 95 k
libcgroup x86_64 0.41-19.el8 baseos 70 k
libslirp x86_64 4.4.0-1.module_el8.7.0+1216+b022c01d appstream 70 k
policycoreutils-python-utils
noarch 2.9-17.el8 baseos 252 k
python3-audit x86_64 3.0-0.17.20191104git1c2f876.el8 baseos 86 k
python3-libsemanage x86_64 2.9-6.el8 baseos 127 k
python3-policycoreutils noarch 2.9-17.el8 baseos 2.2 M
python3-setools x86_64 4.3.0-3.el8 baseos 624 k
slirp4netns x86_64 1.2.0-2.module_el8.7.0+1216+b022c01d appstream 54 k
Installing weak dependencies:
docker-buildx-plugin x86_64 0.10.4-1.el8 docker-ce-stable 12 M
docker-compose-plugin x86_64 2.17.2-1.el8 docker-ce-stable 12 M
Enabling module streams:
container-tools rhel8

Transaction Summary
================================================================================================
Install 20 Packages

Total download size: 97 M
Installed size: 367 M
Downloading Packages:
(1/20): container-selinux-2.195.1-1.module_el8.8.0+1254+78119b6 1.6 MB/s | 63 kB 00:00
(2/20): fuse-overlayfs-1.10-1.module_el8.8.0+1254+78119b6e.x86_ 1.6 MB/s | 74 kB 00:00
(3/20): libslirp-4.4.0-1.module_el8.7.0+1216+b022c01d.x86_64.rp 1.3 MB/s | 70 kB 00:00
(4/20): slirp4netns-1.2.0-2.module_el8.7.0+1216+b022c01d.x86_64 2.6 MB/s | 54 kB 00:00
(5/20): fuse-common-3.3.0-16.el8.x86_64.rpm 1.6 MB/s | 22 kB 00:00
(6/20): fuse3-3.3.0-16.el8.x86_64.rpm 3.2 MB/s | 54 kB 00:00
(7/20): fuse3-libs-3.3.0-16.el8.x86_64.rpm 4.0 MB/s | 95 kB 00:00
(8/20): libcgroup-0.41-19.el8.x86_64.rpm 3.0 MB/s | 70 kB 00:00
(9/20): checkpolicy-2.9-1.el8.x86_64.rpm 4.3 MB/s | 348 kB 00:00
(10/20): python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64.r 2.8 MB/s | 86 kB 00:00
(11/20): policycoreutils-python-utils-2.9-17.el8.noarch.rpm 4.6 MB/s | 252 kB 00:00
(12/20): python3-libsemanage-2.9-6.el8.x86_64.rpm 3.6 MB/s | 127 kB 00:00
(13/20): python3-setools-4.3.0-3.el8.x86_64.rpm 6.8 MB/s | 624 kB 00:00
(14/20): python3-policycoreutils-2.9-17.el8.noarch.rpm 7.9 MB/s | 2.2 MB 00:00
(15/20): docker-buildx-plugin-0.10.4-1.el8.x86_64.rpm 634 kB/s | 12 MB 00:19
(16/20): docker-ce-cli-23.0.3-1.el8.x86_64.rpm 623 kB/s | 7.1 MB 00:11
(17/20): docker-ce-23.0.3-1.el8.x86_64.rpm 661 kB/s | 23 MB 00:36
(18/20): docker-ce-rootless-extras-23.0.3-1.el8.x86_64.rpm 676 kB/s | 4.8 MB 00:07
(19/20): containerd.io-1.6.20-3.1.el8.x86_64.rpm 714 kB/s | 34 MB 00:48
(20/20): docker-compose-plugin-2.17.2-1.el8.x86_64.rpm 761 kB/s | 12 MB 00:15
------------------------------------------------------------------------------------------------
Total 1.9 MB/s | 97 MB 00:52
Docker CE Stable - x86_64 18 kB/s | 1.6 kB 00:00
Importing GPG key 0x621E9F35:
Userid : "Docker Release (CE rpm) <[email protected]>"
Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
From : https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : docker-compose-plugin-2.17.2-1.el8.x86_64 1/20
Running scriptlet: docker-compose-plugin-2.17.2-1.el8.x86_64 1/20
Installing : fuse3-libs-3.3.0-16.el8.x86_64 2/20
Running scriptlet: fuse3-libs-3.3.0-16.el8.x86_64 2/20
Installing : docker-buildx-plugin-0.10.4-1.el8.x86_64 3/20
Running scriptlet: docker-buildx-plugin-0.10.4-1.el8.x86_64 3/20
Installing : docker-ce-cli-1:23.0.3-1.el8.x86_64 4/20
Running scriptlet: docker-ce-cli-1:23.0.3-1.el8.x86_64 4/20
Installing : python3-setools-4.3.0-3.el8.x86_64 5/20
Installing : python3-libsemanage-2.9-6.el8.x86_64 6/20
Installing : python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64 7/20
Running scriptlet: libcgroup-0.41-19.el8.x86_64 8/20
Installing : libcgroup-0.41-19.el8.x86_64 8/20
Running scriptlet: libcgroup-0.41-19.el8.x86_64 8/20
Installing : fuse-common-3.3.0-16.el8.x86_64 9/20
Installing : fuse3-3.3.0-16.el8.x86_64 10/20
Installing : fuse-overlayfs-1.10-1.module_el8.8.0+1254+78119b6e.x86_64 11/20
Running scriptlet: fuse-overlayfs-1.10-1.module_el8.8.0+1254+78119b6e.x86_64 11/20
Installing : checkpolicy-2.9-1.el8.x86_64 12/20
Installing : python3-policycoreutils-2.9-17.el8.noarch 13/20
Installing : policycoreutils-python-utils-2.9-17.el8.noarch 14/20
Running scriptlet: container-selinux-2:2.195.1-1.module_el8.8.0+1254+78119b6e.noarch 15/20
Installing : container-selinux-2:2.195.1-1.module_el8.8.0+1254+78119b6e.noarch 15/20
Running scriptlet: container-selinux-2:2.195.1-1.module_el8.8.0+1254+78119b6e.noarch 15/20

Installing : containerd.io-1.6.20-3.1.el8.x86_64 16/20
Running scriptlet: containerd.io-1.6.20-3.1.el8.x86_64 16/20
Installing : libslirp-4.4.0-1.module_el8.7.0+1216+b022c01d.x86_64 17/20
Installing : slirp4netns-1.2.0-2.module_el8.7.0+1216+b022c01d.x86_64 18/20
Installing : docker-ce-rootless-extras-23.0.3-1.el8.x86_64 19/20
Running scriptlet: docker-ce-rootless-extras-23.0.3-1.el8.x86_64 19/20
Installing : docker-ce-3:23.0.3-1.el8.x86_64 20/20
Running scriptlet: docker-ce-3:23.0.3-1.el8.x86_64 20/20
Running scriptlet: container-selinux-2:2.195.1-1.module_el8.8.0+1254+78119b6e.noarch 20/20
Running scriptlet: docker-ce-3:23.0.3-1.el8.x86_64 20/20
Verifying : container-selinux-2:2.195.1-1.module_el8.8.0+1254+78119b6e.noarch 1/20
Verifying : fuse-overlayfs-1.10-1.module_el8.8.0+1254+78119b6e.x86_64 2/20
Verifying : libslirp-4.4.0-1.module_el8.7.0+1216+b022c01d.x86_64 3/20
Verifying : slirp4netns-1.2.0-2.module_el8.7.0+1216+b022c01d.x86_64 4/20
Verifying : checkpolicy-2.9-1.el8.x86_64 5/20
Verifying : fuse-common-3.3.0-16.el8.x86_64 6/20
Verifying : fuse3-3.3.0-16.el8.x86_64 7/20
Verifying : fuse3-libs-3.3.0-16.el8.x86_64 8/20
Verifying : libcgroup-0.41-19.el8.x86_64 9/20
Verifying : policycoreutils-python-utils-2.9-17.el8.noarch 10/20
Verifying : python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64 11/20
Verifying : python3-libsemanage-2.9-6.el8.x86_64 12/20
Verifying : python3-policycoreutils-2.9-17.el8.noarch 13/20
Verifying : python3-setools-4.3.0-3.el8.x86_64 14/20
Verifying : containerd.io-1.6.20-3.1.el8.x86_64 15/20
Verifying : docker-buildx-plugin-0.10.4-1.el8.x86_64 16/20
Verifying : docker-ce-3:23.0.3-1.el8.x86_64 17/20
Verifying : docker-ce-cli-1:23.0.3-1.el8.x86_64 18/20
Verifying : docker-ce-rootless-extras-23.0.3-1.el8.x86_64 19/20
Verifying : docker-compose-plugin-2.17.2-1.el8.x86_64 20/20

Installed:
checkpolicy-2.9-1.el8.x86_64
container-selinux-2:2.195.1-1.module_el8.8.0+1254+78119b6e.noarch
containerd.io-1.6.20-3.1.el8.x86_64
docker-buildx-plugin-0.10.4-1.el8.x86_64
docker-ce-3:23.0.3-1.el8.x86_64
docker-ce-cli-1:23.0.3-1.el8.x86_64
docker-ce-rootless-extras-23.0.3-1.el8.x86_64
docker-compose-plugin-2.17.2-1.el8.x86_64
fuse-common-3.3.0-16.el8.x86_64
fuse-overlayfs-1.10-1.module_el8.8.0+1254+78119b6e.x86_64
fuse3-3.3.0-16.el8.x86_64
fuse3-libs-3.3.0-16.el8.x86_64
libcgroup-0.41-19.el8.x86_64
libslirp-4.4.0-1.module_el8.7.0+1216+b022c01d.x86_64
policycoreutils-python-utils-2.9-17.el8.noarch
python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64
python3-libsemanage-2.9-6.el8.x86_64
python3-policycoreutils-2.9-17.el8.noarch
python3-setools-4.3.0-3.el8.x86_64
slirp4netns-1.2.0-2.module_el8.7.0+1216+b022c01d.x86_64

Complete!
[root@VM-4-3-centos ~]#
[root@VM-4-3-centos ~]# systemctl enable docker --now
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
[root@VM-4-3-centos ~]# echo "export LC_ALL=en_US.UTF8" >> /etc/profile
[root@VM-4-3-centos ~]# source /etc/profile
[root@VM-4-3-centos ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
[root@VM-4-3-centos ~]# mkdir -p /etc/docker
[root@VM-4-3-centos ~]# sudo tee /etc/docker/daemon.json <<-'EOF'
> {
> "registry-mirrors": ["https://82m9ar63.mirror.aliyuncs.com"],
> "exec-opts": ["native.cgroupdriver=systemd"],
> "log-driver": "json-file",
> "log-opts": {
> "max-size": "100m"
> },
> "storage-driver": "overlay2"
> }
> EOF
{
"registry-mirrors": ["https://82m9ar63.mirror.aliyuncs.com"],
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
[root@VM-4-3-centos ~]# sudo systemctl daemon-reload
[root@VM-4-3-centos ~]# sudo systemctl restart docker
[root@VM-4-3-centos ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@VM-4-3-centos ~]#