概述
1 升级步骤
[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 升级后出现的问题
[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升级以及升级后出现的问题和解决方案所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复