安装docker
首先先更新下yum
命令:sudo yum update
太懒了,直接把完整日志拷贝过来了,加上了备注
###############卸载旧版本(如果有的话)########################## [root@VM_0_11_centos ~]# sudo 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. Repository epel is listed more than once in the configuration No Match for argument: docker-engine Resolving Dependencies --> Running transaction check ---> Package container-selinux.noarch 2:2.119.2-1.911c772.el7_8 will be erased ---> Package docker.x86_64 2:1.13.1-203.git0be3e21.el7.centos will be erased ---> Package docker-common.x86_64 2:1.13.1-203.git0be3e21.el7.centos will be erased --> Processing Dependency: docker-common for package: 2:docker-client-1.13.1-203.git0be3e21.el7.centos.x86_64 --> Running transaction check ---> Package docker-client.x86_64 2:1.13.1-203.git0be3e21.el7.centos will be erased --> Finished Dependency Resolution Dependencies Resolved ========================================================================================================= Package Arch Version Repository Size ========================================================================================================= Removing: container-selinux noarch 2:2.119.2-1.911c772.el7_8 @extras 41 k docker x86_64 2:1.13.1-203.git0be3e21.el7.centos @extras 65 M docker-common x86_64 2:1.13.1-203.git0be3e21.el7.centos @extras 4.4 k Removing for dependencies: docker-client x86_64 2:1.13.1-203.git0be3e21.el7.centos @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-203.git0be3e21.el7.centos.x86_64 1/4 warning: /etc/sysconfig/docker-storage saved as /etc/sysconfig/docker-storage.rpmsave Erasing : 2:docker-client-1.13.1-203.git0be3e21.el7.centos.x86_64 2/4 Erasing : 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64 3/4 Erasing : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 4/4 Verifying : 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64 1/4 Verifying : 2:docker-1.13.1-203.git0be3e21.el7.centos.x86_64 2/4 Verifying : 2:docker-client-1.13.1-203.git0be3e21.el7.centos.x86_64 3/4 Verifying : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 4/4 Removed: container-selinux.noarch 2:2.119.2-1.911c772.el7_8 docker.x86_64 2:1.13.1-203.git0be3e21.el7.centos docker-common.x86_64 2:1.13.1-203.git0be3e21.el7.centos Dependency Removed: docker-client.x86_64 2:1.13.1-203.git0be3e21.el7.centos Complete! ###############【安装需要的软件包】########################## [root@VM_0_11_centos ~]# sudo yum install -y yum-utils device-mapper-persistent-data 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. Repository epel is listed more than once in the configuration Loading mirror speeds from cached hostfile Package yum-utils-1.1.31-54.el7_8.noarch already installed and latest version Package device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64 already installed and latest version Package 7:lvm2-2.02.187-6.el7_9.3.x86_64 already installed and latest version Nothing to do ###############【设置yum源】########################## [root@VM_0_11_centos ~]# sudo 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. Usage: yum-config-manager [options] [section ...] Command line error: no such option: -a ###############【查看所有仓库中的docker版本,并选择指定版本安装】########################## [root@VM_0_11_centos ~]# sudo 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. Repository epel is listed more than once in the configuration 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_11_centos ~]# yum list docker-ce --showduplicates | sort -r Repository epel is listed more than once in the configuration This system is not registered with an entitlement server. You can use subscription-manager to register. : subscription-manager Loading mirror speeds from cached hostfile Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, docker-ce.x86_64 3:20.10.2-3.el7 docker-ce-stable docker-ce.x86_64 3:20.10.1-3.el7 docker-ce-stable docker-ce.x86_64 3:20.10.0-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.9-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.8-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.7-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.6-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.5-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.4-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.3-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.2-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.14-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.1-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.13-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.12-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.11-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.10-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.0-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.9-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.8-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.7-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.6-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.5-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.4-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.3-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.2-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.1-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.0-3.el7 docker-ce-stable docker-ce.x86_64 18.06.3.ce-3.el7 docker-ce-stable docker-ce.x86_64 18.06.2.ce-3.el7 docker-ce-stable docker-ce.x86_64 18.06.1.ce-3.el7 docker-ce-stable docker-ce.x86_64 18.06.0.ce-3.el7 docker-ce-stable docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.03.3.ce-1.el7 docker-ce-stable docker-ce.x86_64 17.03.2.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable Available Packages ###############【安装docker例如:docker-ce-17.12.0.ce】########################## [root@VM_0_11_centos ~]# sudo yum install docker-ce-17.12.0.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. Repository epel is listed more than once in the configuration Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package docker-ce.x86_64 0:17.12.0.ce-1.el7.centos will be installed --> Processing Dependency: container-selinux >= 2.9 for package: docker-ce-17.12.0.ce-1.el7.centos.x86_64 --> Running transaction check ---> Package container-selinux.noarch 2:2.119.2-1.911c772.el7_8 will be installed --> Finished Dependency Resolution Dependencies Resolved ========================================================================================================= Package Arch Version Repository Size ========================================================================================================= Installing: docker-ce x86_64 17.12.0.ce-1.el7.centos docker-ce-stable 30 M Installing for dependencies: container-selinux noarch 2:2.119.2-1.911c772.el7_8 extras 40 k Transaction Summary ========================================================================================================= Install 1 Package (+1 Dependent package) Total download size: 30 M Installed size: 30 M Is this ok [y/d/N]: y Downloading packages: (1/2): 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-17.12.0.ce-1.el7.centos.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY Public key for docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm is not installed (2/2): docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm | 30 MB 00:00:17 --------------------------------------------------------------------------------------------------------- Total 1.7 MB/s | 30 MB 00:00:17 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/2 setsebool: SELinux is disabled. Installing : docker-ce-17.12.0.ce-1.el7.centos.x86_64 2/2 Verifying : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 1/2 Verifying : docker-ce-17.12.0.ce-1.el7.centos.x86_64 2/2 Installed: docker-ce.x86_64 0:17.12.0.ce-1.el7.centos Dependency Installed: container-selinux.noarch 2:2.119.2-1.911c772.el7_8 Complete! ###############【启动并加入开机启动】########################## [root@VM_0_11_centos ~]# sudo systemctl start docker [root@VM_0_11_centos ~]# sudo systemctl enable docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. ###############【验证是否安装成功】########################## [root@VM_0_11_centos ~]# docker version Client: Version: 17.12.0-ce API version: 1.35 Go version: go1.9.2 Git commit: c97c6d6 Built: Wed Dec 27 20:10:14 2017 OS/Arch: linux/amd64 Server: Engine: Version: 17.12.0-ce API version: 1.35 (minimum version 1.12) Go version: go1.9.2 Git commit: c97c6d6 Built: Wed Dec 27 20:12:46 2017 OS/Arch: linux/amd64 Experimental: false
标签: docker
文章来源:
不凡
版权声明:本站所发布的全部内容源于互联网搬运,仅供用于学习和交流,如果有侵权之处请第一时间联系我们删除。敬请谅解! E-mail:xujinxiao@126.com
还木有评论哦,快来抢沙发吧~