Docker容器

CentOS7 下Docker安装、启动

本文主要是介绍CentOS7 下Docker安装、启动,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

为快速安装部署,目前已提供docker一键安装脚本!

1、检查系统内核
      Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker 。

通过 uname -r 命令查看你当前的内核版本。

[xcbeyond@docker ~]$ uname -r
3.10.0-327.10.1.el7.x86_64
 

2、安装Docker
       安装过程及其坎坷,出现了各种问题,并进行记录整个过程,与大家进行分享。2.1 节记录安装过程中出现的各种问题,2.2节整理的是安装成功过程,作为正常安装步骤。

2.1 安装失败
(1)Docker 软件包和依赖包已经包含在默认的 CentOS-Extras 软件源里。执行命令yum install docker

安装过程如下:

[xcbeyond@docker etc]$ sudo yum install docker
Loaded plugins: fastestmirror, langpacks
base                                                             | 3.6 kB  00:00:00     
docker-ce-stable                                                 | 2.9 kB  00:00:00     
extras                                                           | 3.4 kB  00:00:00     
updates                                                          | 3.4 kB  00:00:00     
docker-ce-stable/x86_64/primar FAILED                                          
https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/repodata/251ca0bf128072f68c0ccae90067d231841488501814e0b0b6f492c17c069daa-primary.sqlite.bz2: [Errno 14] curl#60 - "Peer's Certificate issuer is not recognized."
Trying other mirror.
It was impossible to connect to the CentOS servers.
This could mean a connectivity issue in your environment, such as the requirement to configure a proxy,
or a transparent proxy that tampers with TLS security, or an incorrect system clock.
You can try to solve this issue by using the instructions on https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
 
Loading mirror speeds from cached hostfile
 * base: mirrors.nwsuaf.edu.cn
 * extras: mirror.lzu.edu.cn
 * updates: mirrors.163.com
docker-ce-stable/x86_64/primar FAILED                                          
https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/repodata/251ca0bf128072f68c0ccae90067d231841488501814e0b0b6f492c17c069daa-primary.sqlite.bz2: [Errno 14] curl#60 - "Peer's Certificate issuer is not recognized."
Trying other mirror.
docker-ce-stable/x86_64/primary_db                               |  15 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 2:1.13.1-74.git6e3bb8e.el7.centos will be installed
--> Processing Dependency: docker-common = 2:1.13.1-74.git6e3bb8e.el7.centos for package: 2:docker-1.13.1-74.git6e3bb8e.el7.centos.x86_64
--> Processing Dependency: docker-client = 2:1.13.1-74.git6e3bb8e.el7.centos for package: 2:docker-1.13.1-74.git6e3bb8e.el7.centos.x86_64
--> Processing Dependency: subscription-manager-rhsm-certificates for package: 2:docker-1.13.1-74.git6e3bb8e.el7.centos.x86_64
--> Running transaction check
---> Package docker-client.x86_64 2:1.13.1-74.git6e3bb8e.el7.centos will be installed
---> Package docker-common.x86_64 2:1.13.1-74.git6e3bb8e.el7.centos will be installed
--> Processing Dependency: skopeo-containers >= 1:0.1.26-2 for package: 2:docker-common-1.13.1-74.git6e3bb8e.el7.centos.x86_64
--> Processing Dependency: oci-umount >= 2:2.3.3-3 for package: 2:docker-common-1.13.1-74.git6e3bb8e.el7.centos.x86_64
--> Processing Dependency: oci-systemd-hook >= 1:0.1.4-9 for package: 2:docker-common-1.13.1-74.git6e3bb8e.el7.centos.x86_64
--> Processing Dependency: oci-register-machine >= 1:0-5.13 for package: 2:docker-common-1.13.1-74.git6e3bb8e.el7.centos.x86_64
--> Processing Dependency: container-storage-setup >= 0.9.0-1 for package: 2:docker-common-1.13.1-74.git6e3bb8e.el7.centos.x86_64
--> Processing Dependency: container-selinux >= 2:2.51-1 for package: 2:docker-common-1.13.1-74.git6e3bb8e.el7.centos.x86_64
--> Processing Dependency: atomic-registries for package: 2:docker-common-1.13.1-74.git6e3bb8e.el7.centos.x86_64
---> Package subscription-manager-rhsm-certificates.x86_64 0:1.20.11-1.el7.centos will be installed
--> Running transaction check
---> Package atomic-registries.x86_64 1:1.22.1-22.git5a342e3.el7 will be installed
--> Processing Dependency: python-pytoml for package: 1:atomic-registries-1.22.1-22.git5a342e3.el7.x86_64
---> Package container-selinux.noarch 2:2.68-1.el7 will be installed
--> Processing Dependency: selinux-policy-targeted >= 3.13.1-192 for package: 2:container-selinux-2.68-1.el7.noarch
--> Processing Dependency: selinux-policy-base >= 3.13.1-192 for package: 2:container-selinux-2.68-1.el7.noarch
--> Processing Dependency: selinux-policy >= 3.13.1-192 for package: 2:container-selinux-2.68-1.el7.noarch
--> Processing Dependency: policycoreutils >= 2.5-11 for package: 2:container-selinux-2.68-1.el7.noarch
---> Package container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7 will be installed
---> Package oci-register-machine.x86_64 1:0-6.git2b44233.el7 will be installed
---> Package oci-systemd-hook.x86_64 1:0.1.17-2.git83283a0.el7 will be installed
---> Package oci-umount.x86_64 2:2.3.3-3.gite3c9055.el7 will be installed
---> Package skopeo-containers.x86_64 1:0.1.31-1.dev.gitae64ff7.el7.centos will be installed
--> Running transaction check
---> Package policycoreutils.x86_64 0:2.2.5-20.el7 will be updated
--> Processing Dependency: policycoreutils = 2.2.5-20.el7 for package: policycoreutils-python-2.2.5-20.el7.x86_64
---> Package policycoreutils.x86_64 0:2.5-22.el7 will be an update
--> Processing Dependency: libsepol >= 2.5-8 for package: policycoreutils-2.5-22.el7.x86_64
--> Processing Dependency: libselinux-utils >= 2.5-12 for package: policycoreutils-2.5-22.el7.x86_64
--> Processing Dependency: libsepol.so.1(LIBSEPOL_1.1)(64bit) for package: policycoreutils-2.5-22.el7.x86_64
--> Processing Dependency: libsepol.so.1(LIBSEPOL_1.0)(64bit) for package: policycoreutils-2.5-22.el7.x86_64
--> Processing Dependency: libsemanage.so.1(LIBSEMANAGE_1.1)(64bit) for package: policycoreutils-2.5-22.el7.x

更多请见:http://www.mark-to-win.com/tutorial/50475.html

这篇关于CentOS7 下Docker安装、启动的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!