1 升级步骤
复制代码
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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379[root@VM_0_12_centos ~]# docker info Containers: 11 Running: 9 Paused: 0 Stopped: 2 Images: 10 Server Version: 1.13.1 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: journald Cgroup Driver: systemd Plugins: Volume: local Network: bridge host macvlan null overlay Swarm: inactive Runtimes: docker-runc runc Default Runtime: docker-runc Init Binary: /usr/libexec/docker/docker-init-current containerd version: (expected: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1) runc version: 66aedde759f33c190954815fb765eedc1d782dd9 (expected: 9df8b306d01f59d3a8029be411de015b7304dd8f) init version: fec3683b971d9c3ef73f284f176672c44b448662 (expected: 949e6facb77383876aeff8a6944dde66b3089574) Security Options: seccomp WARNING: You're not using the default seccomp profile Profile: /etc/docker/seccomp.json Kernel Version: 3.10.0-957.21.3.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 Number of Docker Hooks: 3 CPUs: 1 Total Memory: 1.795 GiB Name: VM_0_12_centos ID: NAJR:PTAA:D4GU:F56W:KCHM:GAJ3:B4I6:BCS4:4XXK:STHG:WDOM:2TQF Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Experimental: false Insecure Registries: 127.0.0.0/8 Registry Mirrors: http://hub-mirror.c.163.com/ Live Restore Enabled: false Registries: docker.io (secure) [root@VM_0_12_centos ~]# vi /etc/docker/daemon.json [root@VM_0_12_centos ~]# cat /etc/docker/daemon.json { "registry-mirrors":["https://n62k26ut.mirror.aliyuncs.com"] } [root@VM_0_12_centos ~]# yum install -y yum-utils device-mapper-persistent lvm2 Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. Determining fastest mirrors docker-ce-nightly | 3.5 kB 00:00:00 docker-ce-stable | 3.5 kB 00:00:00 epel | 4.7 kB 00:00:00 extras | 2.9 kB 00:00:00 mysql-connectors-community | 2.5 kB 00:00:00 mysql-tools-community | 2.5 kB 00:00:00 mysql57-community | 2.5 kB 00:00:00 os | 3.6 kB 00:00:00 updates | 2.9 kB 00:00:00 (1/8): epel/7/x86_64/group_gz | 95 kB 00:00:00 (2/8): epel/7/x86_64/updateinfo | 1.0 MB 00:00:01 (3/8): extras/7/x86_64/primary_db | 206 kB 00:00:00 (4/8): mysql-connectors-community/x86_64/primary_db | 62 kB 00:00:00 (5/8): mysql-tools-community/x86_64/primary_db | 76 kB 00:00:01 (6/8): updates/7/x86_64/primary_db | 4.5 MB 00:00:01 (7/8): mysql57-community/x86_64/primary_db | 224 kB 00:00:01 (8/8): epel/7/x86_64/primary_db | 6.9 MB 00:00:02 No package device-mapper-persistent available. Resolving Dependencies --> Running transaction check ---> Package lvm2.x86_64 7:2.02.186-7.el7_8.1 will be updated ---> Package lvm2.x86_64 7:2.02.186-7.el7_8.2 will be an update --> Processing Dependency: lvm2-libs = 7:2.02.186-7.el7_8.2 for package: 7:lvm2-2.02.186-7.el7_8.2.x86_64 ---> Package yum-utils.noarch 0:1.1.31-53.el7 will be updated ---> Package yum-utils.noarch 0:1.1.31-54.el7_8 will be an update --> Running transaction check ---> Package lvm2-libs.x86_64 7:2.02.186-7.el7_8.1 will be updated ---> Package lvm2-libs.x86_64 7:2.02.186-7.el7_8.2 will be an update --> Processing Dependency: device-mapper-event = 7:1.02.164-7.el7_8.2 for package: 7:lvm2-libs-2.02.186-7.el7_8.2.x86_64 --> Running transaction check ---> Package device-mapper-event.x86_64 7:1.02.164-7.el7_8.1 will be updated ---> Package device-mapper-event.x86_64 7:1.02.164-7.el7_8.2 will be an update --> Processing Dependency: device-mapper-event-libs = 7:1.02.164-7.el7_8.2 for package: 7:device-mapper-event-1.02.164-7.el7_8.2.x86_64 --> Processing Dependency: device-mapper = 7:1.02.164-7.el7_8.2 for package: 7:device-mapper-event-1.02.164-7.el7_8.2.x86_64 --> Running transaction check ---> Package device-mapper.x86_64 7:1.02.164-7.el7_8.1 will be updated --> Processing Dependency: device-mapper = 7:1.02.164-7.el7_8.1 for package: 7:device-mapper-libs-1.02.164-7.el7_8.1.x86_64 ---> Package device-mapper.x86_64 7:1.02.164-7.el7_8.2 will be an update ---> Package device-mapper-event-libs.x86_64 7:1.02.164-7.el7_8.1 will be updated ---> Package device-mapper-event-libs.x86_64 7:1.02.164-7.el7_8.2 will be an update --> Running transaction check ---> Package device-mapper-libs.x86_64 7:1.02.164-7.el7_8.1 will be updated ---> Package device-mapper-libs.x86_64 7:1.02.164-7.el7_8.2 will be an update --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================== Package Arch Version Repository Size ====================================================================================================== Updating: lvm2 x86_64 7:2.02.186-7.el7_8.2 updates 1.3 M yum-utils noarch 1.1.31-54.el7_8 updates 122 k Updating for dependencies: device-mapper x86_64 7:1.02.164-7.el7_8.2 updates 295 k device-mapper-event x86_64 7:1.02.164-7.el7_8.2 updates 191 k device-mapper-event-libs x86_64 7:1.02.164-7.el7_8.2 updates 190 k device-mapper-libs x86_64 7:1.02.164-7.el7_8.2 updates 324 k lvm2-libs x86_64 7:2.02.186-7.el7_8.2 updates 1.1 M Transaction Summary ====================================================================================================== Upgrade 2 Packages (+5 Dependent packages) Total download size: 3.5 M Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. (1/7): device-mapper-event-1.02.164-7.el7_8.2.x86_64.rpm | 191 kB 00:00:00 (2/7): device-mapper-1.02.164-7.el7_8.2.x86_64.rpm | 295 kB 00:00:00 (3/7): device-mapper-event-libs-1.02.164-7.el7_8.2.x86_64.rpm | 190 kB 00:00:00 (4/7): device-mapper-libs-1.02.164-7.el7_8.2.x86_64.rpm | 324 kB 00:00:00 (5/7): lvm2-2.02.186-7.el7_8.2.x86_64.rpm | 1.3 MB 00:00:00 (6/7): lvm2-libs-2.02.186-7.el7_8.2.x86_64.rpm | 1.1 MB 00:00:00 (7/7): yum-utils-1.1.31-54.el7_8.noarch.rpm | 122 kB 00:00:00 ------------------------------------------------------------------------------------------------------ Total 2.0 MB/s | 3.5 MB 00:00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : 7:device-mapper-libs-1.02.164-7.el7_8.2.x86_64 1/14 Updating : 7:device-mapper-1.02.164-7.el7_8.2.x86_64 2/14 Updating : 7:device-mapper-event-libs-1.02.164-7.el7_8.2.x86_64 3/14 Updating : 7:device-mapper-event-1.02.164-7.el7_8.2.x86_64 4/14 Updating : 7:lvm2-libs-2.02.186-7.el7_8.2.x86_64 5/14 Updating : 7:lvm2-2.02.186-7.el7_8.2.x86_64 6/14 Updating : yum-utils-1.1.31-54.el7_8.noarch 7/14 Cleanup : 7:lvm2-2.02.186-7.el7_8.1.x86_64 8/14 Cleanup : yum-utils-1.1.31-53.el7.noarch 9/14 Cleanup : 7:lvm2-libs-2.02.186-7.el7_8.1.x86_64 10/14 Cleanup : 7:device-mapper-event-1.02.164-7.el7_8.1.x86_64 11/14 Cleanup : 7:device-mapper-event-libs-1.02.164-7.el7_8.1.x86_64 12/14 Cleanup : 7:device-mapper-libs-1.02.164-7.el7_8.1.x86_64 13/14 Cleanup : 7:device-mapper-1.02.164-7.el7_8.1.x86_64 14/14 Verifying : 7:device-mapper-1.02.164-7.el7_8.2.x86_64 1/14 Verifying : 7:lvm2-libs-2.02.186-7.el7_8.2.x86_64 2/14 Verifying : 7:device-mapper-event-1.02.164-7.el7_8.2.x86_64 3/14 Verifying : 7:lvm2-2.02.186-7.el7_8.2.x86_64 4/14 Verifying : 7:device-mapper-libs-1.02.164-7.el7_8.2.x86_64 5/14 Verifying : yum-utils-1.1.31-54.el7_8.noarch 6/14 Verifying : 7:device-mapper-event-libs-1.02.164-7.el7_8.2.x86_64 7/14 Verifying : 7:device-mapper-event-libs-1.02.164-7.el7_8.1.x86_64 8/14 Verifying : yum-utils-1.1.31-53.el7.noarch 9/14 Verifying : 7:lvm2-libs-2.02.186-7.el7_8.1.x86_64 10/14 Verifying : 7:device-mapper-event-1.02.164-7.el7_8.1.x86_64 11/14 Verifying : 7:device-mapper-1.02.164-7.el7_8.1.x86_64 12/14 Verifying : 7:device-mapper-libs-1.02.164-7.el7_8.1.x86_64 13/14 Verifying : 7:lvm2-2.02.186-7.el7_8.1.x86_64 14/14 Updated: lvm2.x86_64 7:2.02.186-7.el7_8.2 yum-utils.noarch 0:1.1.31-54.el7_8 Dependency Updated: device-mapper.x86_64 7:1.02.164-7.el7_8.2 device-mapper-event.x86_64 7:1.02.164-7.el7_8.2 device-mapper-event-libs.x86_64 7:1.02.164-7.el7_8.2 device-mapper-libs.x86_64 7:1.02.164-7.el7_8.2 lvm2-libs.x86_64 7:2.02.186-7.el7_8.2 Complete! [root@VM_0_12_centos ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo Loaded plugins: fastestmirror, langpacks, product-id, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. adding repo from: https://download.docker.com/linux/centos/docker-ce.repo grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo repo saved to /etc/yum.repos.d/docker-ce.repo [root@VM_0_12_centos ~]# ll /etc/yum.repos.d/ total 20 -rw-r--r-- 1 root root 614 Oct 4 2019 CentOS-Base.repo -rw-r--r-- 1 root root 230 Oct 4 2019 CentOS-Epel.repo -rw-r--r-- 1 root root 2424 Jul 28 19:08 docker-ce.repo -rw-r--r-- 1 root root 1838 Apr 27 2017 mysql-community.repo -rw-r--r-- 1 root root 1885 Apr 27 2017 mysql-community-source.repo [root@VM_0_12_centos ~]# service docker stop Redirecting to /bin/systemctl stop docker.service [root@VM_0_12_centos ~]# yum remove docker docker-common docker-selinux docker-engine Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. No Match for argument: docker-engine Resolving Dependencies --> Running transaction check ---> Package container-selinux.noarch 2:2.119.1-1.c57a6f9.el7 will be erased ---> Package docker.x86_64 2:1.13.1-161.git64e9980.el7_8 will be erased ---> Package docker-common.x86_64 2:1.13.1-161.git64e9980.el7_8 will be erased --> Processing Dependency: docker-common for package: 2:docker-client-1.13.1-161.git64e9980.el7_8.x86_64 --> Running transaction check ---> Package docker-client.x86_64 2:1.13.1-161.git64e9980.el7_8 will be erased --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================== Package Arch Version Repository Size ====================================================================================================== Removing: container-selinux noarch 2:2.119.1-1.c57a6f9.el7 @extras 41 k docker x86_64 2:1.13.1-161.git64e9980.el7_8 @extras 65 M docker-common x86_64 2:1.13.1-161.git64e9980.el7_8 @extras 4.4 k Removing for dependencies: docker-client x86_64 2:1.13.1-161.git64e9980.el7_8 @extras 13 M Transaction Summary ====================================================================================================== Remove 3 Packages (+1 Dependent package) Installed size: 77 M Is this ok [y/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Erasing : 2:docker-1.13.1-161.git64e9980.el7_8.x86_64 1/4 warning: /etc/sysconfig/docker-storage saved as /etc/sysconfig/docker-storage.rpmsave warning: /etc/docker/daemon.json saved as /etc/docker/daemon.json.rpmsave Erasing : 2:docker-client-1.13.1-161.git64e9980.el7_8.x86_64 2/4 Erasing : 2:docker-common-1.13.1-161.git64e9980.el7_8.x86_64 3/4 warning: /etc/sysconfig/docker saved as /etc/sysconfig/docker.rpmsave Erasing : 2:container-selinux-2.119.1-1.c57a6f9.el7.noarch 4/4 Verifying : 2:container-selinux-2.119.1-1.c57a6f9.el7.noarch 1/4 Verifying : 2:docker-client-1.13.1-161.git64e9980.el7_8.x86_64 2/4 Verifying : 2:docker-common-1.13.1-161.git64e9980.el7_8.x86_64 3/4 Verifying : 2:docker-1.13.1-161.git64e9980.el7_8.x86_64 4/4 Removed: container-selinux.noarch 2:2.119.1-1.c57a6f9.el7 docker.x86_64 2:1.13.1-161.git64e9980.el7_8 docker-common.x86_64 2:1.13.1-161.git64e9980.el7_8 Dependency Removed: docker-client.x86_64 2:1.13.1-161.git64e9980.el7_8 Complete! [root@VM_0_12_centos ~]# yum install docker-ce Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package docker-ce.x86_64 3:19.03.12-3.el7 will be installed --> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-19.03.12-3.el7.x86_64 --> Processing Dependency: containerd.io >= 1.2.2-3 for package: 3:docker-ce-19.03.12-3.el7.x86_64 --> Processing Dependency: docker-ce-cli for package: 3:docker-ce-19.03.12-3.el7.x86_64 --> Running transaction check ---> Package container-selinux.noarch 2:2.119.2-1.911c772.el7_8 will be installed ---> Package containerd.io.x86_64 0:1.2.13-3.2.el7 will be installed ---> Package docker-ce-cli.x86_64 1:19.03.12-3.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================== Package Arch Version Repository Size ====================================================================================================== Installing: docker-ce x86_64 3:19.03.12-3.el7 docker-ce-stable 24 M Installing for dependencies: container-selinux noarch 2:2.119.2-1.911c772.el7_8 extras 40 k containerd.io x86_64 1.2.13-3.2.el7 docker-ce-stable 25 M docker-ce-cli x86_64 1:19.03.12-3.el7 docker-ce-stable 38 M Transaction Summary ====================================================================================================== Install 1 Package (+3 Dependent packages) Total download size: 88 M Installed size: 360 M Is this ok [y/d/N]: y Downloading packages: (1/4): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm | 40 kB 00:00:00 warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/docker-ce-19.03.12-3.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY Public key for docker-ce-19.03.12-3.el7.x86_64.rpm is not installed (2/4): docker-ce-19.03.12-3.el7.x86_64.rpm | 24 MB 00:00:04 (3/4): containerd.io-1.2.13-3.2.el7.x86_64.rpm | 25 MB 00:00:05 (4/4): docker-ce-cli-19.03.12-3.el7.x86_64.rpm | 38 MB 00:00:05 ------------------------------------------------------------------------------------------------------ Total 8.5 MB/s | 88 MB 00:00:10 Retrieving key from https://download.docker.com/linux/centos/gpg Importing GPG key 0x621E9F35: Userid : "Docker Release (CE rpm) <docker@docker.com>" Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35 From : https://download.docker.com/linux/centos/gpg Is this ok [y/N]: y Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 1/4 setsebool: SELinux is disabled. Installing : containerd.io-1.2.13-3.2.el7.x86_64 2/4 Installing : 1:docker-ce-cli-19.03.12-3.el7.x86_64 3/4 Installing : 3:docker-ce-19.03.12-3.el7.x86_64 4/4 Verifying : 1:docker-ce-cli-19.03.12-3.el7.x86_64 1/4 Verifying : 3:docker-ce-19.03.12-3.el7.x86_64 2/4 Verifying : containerd.io-1.2.13-3.2.el7.x86_64 3/4 Verifying : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 4/4 Installed: docker-ce.x86_64 3:19.03.12-3.el7 Dependency Installed: container-selinux.noarch 2:2.119.2-1.911c772.el7_8 containerd.io.x86_64 0:1.2.13-3.2.el7 docker-ce-cli.x86_64 1:19.03.12-3.el7 Complete! [root@VM_0_12_centos ~]# service docker start Redirecting to /bin/systemctl start docker.service [root@VM_0_12_centos ~]# docker info Client: Debug Mode: false Server: Containers: 10 Running: 0 Paused: 0 Stopped: 10 Images: 10 Server Version: 19.03.12 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd init version: fec3683 Security Options: seccomp Profile: default Kernel Version: 3.10.0-957.21.3.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 CPUs: 1 Total Memory: 1.795GiB Name: VM_0_12_centos ID: NAJR:PTAA:D4GU:F56W:KCHM:GAJ3:B4I6:BCS4:4XXK:STHG:WDOM:2TQF Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false
2 升级后出现的问题
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24[root@VM_0_12_centos ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES df9b59dd2435 2622e6cca7eb "/docker-entrypoint.…" 6 weeks ago Exited (0) 5 minutes ago nginx2 088448030a8c 6d11486a97a7 "docker-entrypoint.s…" 7 weeks ago Exited (0) 5 minutes ago mongo a1faa4d7acbc docker.elastic.co/kibana/kibana:7.8.0 "/usr/local/bin/dumb…" 8 weeks ago Exited (137) 5 minutes ago kebana a8687df90b04 235592615444 "docker-entrypoint.s…" 8 weeks ago Exited (0) 5 minutes ago redis cc5457c89cb1 docker.elastic.co/elasticsearch/elasticsearch:7.8.0 "/tini -- /usr/local…" 2 months ago Exited (137) 5 minutes ago es 0bbe944bdfef f1905dce9659 "start-kafka.sh" 2 months ago Exited (137) 5 minutes ago 0.0.0.0:9092->9092/tcp kafka 6850993420b8 3f43f72cb283 "/bin/sh -c '/usr/sb…" 2 months ago Exited (137) 5 minutes ago 22/tcp, 2888/tcp, 3888/tcp, 0.0.0.0:2181->2181/tcp zookeeper [root@VM_0_12_centos ~]# docker start df Error response from daemon: Unknown runtime specified docker-runc Error: failed to start containers: df [root@VM_0_12_centos ~]# docker restart df9b Error response from daemon: Cannot restart container df9b: no such runtime 'docker-runc' [root@VM_0_12_centos ~]# docker start df9b Error response from daemon: Unknown runtime specified docker-runc Error: failed to start containers: df9b [root@VM_0_12_centos ~]# grep -rl 'docker-runc' /var/lib/docker/containers/ | xargs sed -i 's/docker-runc/runc/g' [root@VM_0_12_centos ~]# systemctl stop docker [root@VM_0_12_centos ~]# systemctl start docker [root@VM_0_12_centos ~]# docker start df9b df9b
最后
以上就是可靠手机最近收集整理的关于Docker升级以及升级后出现的问题和解决方案的全部内容,更多相关Docker升级以及升级后出现内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复