docker环境搭建
docker的官方指导(centos):https://docs.docker.com/engine/install/centos/
准备:
1、配置好阿里的yum源
2、服务器操作系统:centos7.3_x64
安装
1、安装依赖库
命令:
yum install -y yum-utils device-mapper-persistent-data lvm2
[root@master tools]# yum install -y yum-utils device-mapper-persistent-data lvm2
已加载插件:fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Aliyun_7.0_base | 2.9 kB 00:00:00
Aliyun_7.0_extras | 2.9 kB 00:00:00
Aliyun_7.0_updates | 2.9 kB 00:00:00
Centos_7.0_base | 2.9 kB 00:00:00
Centos_7.0_extras | 2.9 kB 00:00:00
Centos_7.0_updates | 2.9 kB 00:00:00
epel_7 | 2.9 kB 00:00:00
(1/3): Aliyun_7.0_extras/primary_db | 165 kB 00:00:00
(2/3): Aliyun_7.0_updates/primary_db | 7.5 MB 00:00:00
(3/3): Aliyun_7.0_base/primary_db | 6.1 MB 00:00:00
Determining fastest mirrors
正在解决依赖关系
--> 正在检查事务
---> 软件包 device-mapper-persistent-data.x86_64.0.0.6.3-1.el7 将被 升级
---> 软件包 device-mapper-persistent-data.x86_64.0.0.8.5-1.el7 将被 更新
---> 软件包 lvm2.x86_64.7.2.02.166-1.el7 将被 升级
---> 软件包 lvm2.x86_64.7.2.02.185-2.el7_7.2 将被 更新
--> 正在处理依赖关系 lvm2-libs = 7:2.02.185-2.el7_7.2,它被软件包 7:lvm2-2.02.185-2.el7_7.2.x86_64 需要
--> 正在处理依赖关系 libdevmapper.so.1.02(DM_1_02_141)(64bit),它被软件包 7:lvm2-2.02.185-2.el7_7.2.x86_64 需要
--> 正在处理依赖关系 libdevmapper.so.1.02(DM_1_02_138)(64bit),它被软件包 7:lvm2-2.02.185-2.el7_7.2.x86_64 需要
---> 软件包 yum-utils.noarch.0.1.1.31-40.el7 将被 升级
---> 软件包 yum-utils.noarch.0.1.1.31-52.el7 将被 更新
--> 正在检查事务
---> 软件包 device-mapper-libs.x86_64.7.1.02.135-1.el7 将被 升级
--> 正在处理依赖关系 device-mapper-libs = 7:1.02.135-1.el7,它被软件包 7:device-mapper-1.02.135-1.el7.x86_64 需要
---> 软件包 device-mapper-libs.x86_64.7.1.02.158-2.el7_7.2 将被 更新
---> 软件包 lvm2-libs.x86_64.7.2.02.166-1.el7 将被 升级
---> 软件包 lvm2-libs.x86_64.7.2.02.185-2.el7_7.2 将被 更新
--> 正在处理依赖关系 device-mapper-event = 7:1.02.158-2.el7_7.2,它被软件包 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64 需要
--> 正在检查事务
---> 软件包 device-mapper.x86_64.7.1.02.135-1.el7 将被 升级
---> 软件包 device-mapper.x86_64.7.1.02.158-2.el7_7.2 将被 更新
---> 软件包 device-mapper-event.x86_64.7.1.02.135-1.el7 将被 升级
---> 软件包 device-mapper-event.x86_64.7.1.02.158-2.el7_7.2 将被 更新
--> 正在处理依赖关系 device-mapper-event-libs = 7:1.02.158-2.el7_7.2,它被软件包 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64 需要
--> 正在检查事务
---> 软件包 device-mapper-event-libs.x86_64.7.1.02.135-1.el7 将被 升级
---> 软件包 device-mapper-event-libs.x86_64.7.1.02.158-2.el7_7.2 将被 更新
--> 解决依赖关系完成
依赖关系解决
=============================================================================================================================================================================================
Package 架构 版本 源 大小
=============================================================================================================================================================================================
正在更新:
device-mapper-persistent-data x86_64 0.8.5-1.el7 Aliyun_7.0_base 423 k
lvm2 x86_64 7:2.02.185-2.el7_7.2 Aliyun_7.0_updates 1.3 M
yum-utils noarch 1.1.31-52.el7 Aliyun_7.0_base 121 k
为依赖而更新:
device-mapper x86_64 7:1.02.158-2.el7_7.2 Aliyun_7.0_updates 294 k
device-mapper-event x86_64 7:1.02.158-2.el7_7.2 Aliyun_7.0_updates 190 k
device-mapper-event-libs x86_64 7:1.02.158-2.el7_7.2 Aliyun_7.0_updates 189 k
device-mapper-libs x86_64 7:1.02.158-2.el7_7.2 Aliyun_7.0_updates 322 k
lvm2-libs x86_64 7:2.02.185-2.el7_7.2 Aliyun_7.0_updates 1.1 M
事务概要
=============================================================================================================================================================================================
升级 3 软件包 (+5 依赖软件包)
总下载量:3.9 M
Downloading packages:
No Presto metadata available for Aliyun_7.0_updates
No Presto metadata available for Aliyun_7.0_base
(1/8): device-mapper-1.02.158-2.el7_7.2.x86_64.rpm | 294 kB 00:00:00
(2/8): device-mapper-event-1.02.158-2.el7_7.2.x86_64.rpm | 190 kB 00:00:00
(3/8): device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64.rpm | 189 kB 00:00:00
(4/8): device-mapper-libs-1.02.158-2.el7_7.2.x86_64.rpm | 322 kB 00:00:00
(5/8): lvm2-2.02.185-2.el7_7.2.x86_64.rpm | 1.3 MB 00:00:00
(6/8): device-mapper-persistent-data-0.8.5-1.el7.x86_64.rpm | 423 kB 00:00:00
(7/8): yum-utils-1.1.31-52.el7.noarch.rpm | 121 kB 00:00:00
(8/8): lvm2-libs-2.02.185-2.el7_7.2.x86_64.rpm | 1.1 MB 00:00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 17 MB/s | 3.9 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64 1/16
正在更新 : 7:device-mapper-1.02.158-2.el7_7.2.x86_64 2/16
正在更新 : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64 3/16
正在更新 : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64 4/16
正在更新 : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64 5/16
正在更新 : device-mapper-persistent-data-0.8.5-1.el7.x86_64 6/16
正在更新 : 7:lvm2-2.02.185-2.el7_7.2.x86_64 7/16
正在更新 : yum-utils-1.1.31-52.el7.noarch 8/16
清理 : yum-utils-1.1.31-40.el7.noarch 9/16
清理 : 7:lvm2-2.02.166-1.el7.x86_64 10/16
清理 : 7:lvm2-libs-2.02.166-1.el7.x86_64 11/16
清理 : 7:device-mapper-event-1.02.135-1.el7.x86_64 12/16
清理 : 7:device-mapper-event-libs-1.02.135-1.el7.x86_64 13/16
清理 : 7:device-mapper-libs-1.02.135-1.el7.x86_64 14/16
清理 : 7:device-mapper-1.02.135-1.el7.x86_64 15/16
清理 : device-mapper-persistent-data-0.6.3-1.el7.x86_64 16/16
验证中 : 7:device-mapper-1.02.158-2.el7_7.2.x86_64 1/16
验证中 : device-mapper-persistent-data-0.8.5-1.el7.x86_64 2/16
验证中 : yum-utils-1.1.31-52.el7.noarch 3/16
验证中 : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64 4/16
验证中 : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64 5/16
验证中 : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64 6/16
验证中 : 7:lvm2-2.02.185-2.el7_7.2.x86_64 7/16
验证中 : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64 8/16
验证中 : device-mapper-persistent-data-0.6.3-1.el7.x86_64 9/16
验证中 : 7:device-mapper-event-libs-1.02.135-1.el7.x86_64 10/16
验证中 : 7:device-mapper-1.02.135-1.el7.x86_64 11/16
验证中 : 7:lvm2-2.02.166-1.el7.x86_64 12/16
验证中 : yum-utils-1.1.31-40.el7.noarch 13/16
验证中 : 7:device-mapper-libs-1.02.135-1.el7.x86_64 14/16
验证中 : 7:device-mapper-event-1.02.135-1.el7.x86_64 15/16
验证中 : 7:lvm2-libs-2.02.166-1.el7.x86_64 16/16
更新完毕:
device-mapper-persistent-data.x86_64 0:0.8.5-1.el7 lvm2.x86_64 7:2.02.185-2.el7_7.2 yum-utils.noarch 0:1.1.31-52.el7
作为依赖被升级:
device-mapper.x86_64 7:1.02.158-2.el7_7.2 device-mapper-event.x86_64 7:1.02.158-2.el7_7.2 device-mapper-event-libs.x86_64 7:1.02.158-2.el7_7.2
device-mapper-libs.x86_64 7:1.02.158-2.el7_7.2 lvm2-libs.x86_64 7:2.02.185-2.el7_7.2
完毕!
2、安装docker软件
命令:yum -y install docker
[root@master tools]# yum -y install docker
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 docker.x86_64.2.1.13.1-109.gitcccb291.el7.centos 将被 安装
--> 正在处理依赖关系 docker-common = 2:1.13.1-109.gitcccb291.el7.centos,它被软件包 2:docker-1.13.1-109.gitcccb291.el7.centos.x86_64 需要
--> 正在处理依赖关系 docker-client = 2:1.13.1-109.gitcccb291.el7.centos,它被软件包 2:docker-1.13.1-109.gitcccb291.el7.centos.x86_64 需要
--> 正在处理依赖关系 subscription-manager-rhsm-certificates,它被软件包 2:docker-1.13.1-109.gitcccb291.el7.centos.x86_64 需要
--> 正在检查事务
---> 软件包 docker-client.x86_64.2.1.13.1-109.gitcccb291.el7.centos 将被 安装
---> 软件包 docker-common.x86_64.2.1.13.1-109.gitcccb291.el7.centos 将被 安装
--> 正在处理依赖关系 skopeo-containers >= 1:0.1.26-2,它被软件包 2:docker-common-1.13.1-109.gitcccb291.el7.centos.x86_64 需要
--> 正在处理依赖关系 oci-umount >= 2:2.3.3-3,它被软件包 2:docker-common-1.13.1-109.gitcccb291.el7.centos.x86_64 需要
--> 正在处理依赖关系 oci-systemd-hook >= 1:0.1.4-9,它被软件包 2:docker-common-1.13.1-109.gitcccb291.el7.centos.x86_64 需要
--> 正在处理依赖关系 oci-register-machine >= 1:0-5.13,它被软件包 2:docker-common-1.13.1-109.gitcccb291.el7.centos.x86_64 需要
--> 正在处理依赖关系 container-storage-setup >= 0.9.0-1,它被软件包 2:docker-common-1.13.1-109.gitcccb291.el7.centos.x86_64 需要
--> 正在处理依赖关系 container-selinux >= 2:2.51-1,它被软件包 2:docker-common-1.13.1-109.gitcccb291.el7.centos.x86_64 需要
--> 正在处理依赖关系 atomic-registries,它被软件包 2:docker-common-1.13.1-109.gitcccb291.el7.centos.x86_64 需要
---> 软件包 subscription-manager-rhsm-certificates.x86_64.0.1.24.13-4.el7.centos 将被 安装
--> 正在检查事务
---> 软件包 atomic-registries.x86_64.1.1.22.1-29.gitb507039.el7 将被 安装
--> 正在处理依赖关系 python-yaml,它被软件包 1:atomic-registries-1.22.1-29.gitb507039.el7.x86_64 需要
--> 正在处理依赖关系 python-pytoml,它被软件包 1:atomic-registries-1.22.1-29.gitb507039.el7.x86_64 需要
---> 软件包 container-selinux.noarch.2.2.107-3.el7 将被 安装
--> 正在处理依赖关系 selinux-policy-targeted >= 3.13.1-216.el7,它被软件包 2:container-selinux-2.107-3.el7.noarch 需要
--> 正在处理依赖关系 selinux-policy-base >= 3.13.1-216.el7,它被软件包 2:container-selinux-2.107-3.el7.noarch 需要
--> 正在处理依赖关系 selinux-policy >= 3.13.1-216.el7,它被软件包 2:container-selinux-2.107-3.el7.noarch 需要
--> 正在处理依赖关系 policycoreutils >= 2.5-11,它被软件包 2:container-selinux-2.107-3.el7.noarch 需要
---> 软件包 container-storage-setup.noarch.0.0.11.0-2.git5eaf76c.el7 将被 安装
---> 软件包 containers-common.x86_64.1.0.1.37-3.el7.centos 将被 安装
---> 软件包 oci-register-machine.x86_64.1.0-6.git2b44233.el7 将被 安装
---> 软件包 oci-systemd-hook.x86_64.1.0.2.0-1.git05e6923.el7_6 将被 安装
---> 软件包 oci-umount.x86_64.2.2.5-3.el7 将被 安装
--> 正在检查事务
---> 软件包 PyYAML.x86_64.0.3.10-11.el7 将被 安装
---> 软件包 policycoreutils.x86_64.0.2.5-8.el7 将被 升级
--> 正在处理依赖关系 policycoreutils = 2.5-8.el7,它被软件包 policycoreutils-python-2.5-8.el7.x86_64 需要
---> 软件包 policycoreutils.x86_64.0.2.5-33.el7 将被 更新
--> 正在处理依赖关系 libsepol >= 2.5-10,它被软件包 policycoreutils-2.5-33.el7.x86_64 需要
--> 正在处理依赖关系 libsemanage >= 2.5-14,它被软件包 policycoreutils-2.5-33.el7.x86_64 需要
--> 正在处理依赖关系 libselinux-utils >= 2.5-14,它被软件包 policycoreutils-2.5-33.el7.x86_64 需要
---> 软件包 python-pytoml.noarch.0.0.1.14-1.git7dea353.el7 将被 安装
---> 软件包 selinux-policy.noarch.0.3.13.1-102.el7 将被 升级
---> 软件包 selinux-policy.noarch.0.3.13.1-252.el7_7.6 将被 更新
---> 软件包 selinux-policy-targeted.noarch.0.3.13.1-102.el7 将被 升级
---> 软件包 selinux-policy-targeted.noarch.0.3.13.1-252.el7_7.6 将被 更新
--> 正在检查事务
---> 软件包 libselinux-utils.x86_64.0.2.5-6.el7 将被 升级
---> 软件包 libselinux-utils.x86_64.0.2.5-14.1.el7 将被 更新
--> 正在处理依赖关系 libselinux(x86-64) = 2.5-14.1.el7,它被软件包 libselinux-utils-2.5-14.1.el7.x86_64 需要
---> 软件包 libsemanage.x86_64.0.2.5-4.el7 将被 升级
--> 正在处理依赖关系 libsemanage = 2.5-4.el7,它被软件包 libsemanage-python-2.5-4.el7.x86_64 需要
---> 软件包 libsemanage.x86_64.0.2.5-14.el7 将被 更新
---> 软件包 libsepol.x86_64.0.2.5-6.el7 将被 升级
---> 软件包 libsepol.x86_64.0.2.5-10.el7 将被 更新
---> 软件包 policycoreutils-python.x86_64.0.2.5-8.el7 将被 升级
---> 软件包 policycoreutils-python.x86_64.0.2.5-33.el7 将被 更新
--> 正在处理依赖关系 setools-libs >= 3.3.8-4,它被软件包 policycoreutils-python-2.5-33.el7.x86_64 需要
--> 正在检查事务
---> 软件包 libselinux.x86_64.0.2.5-6.el7 将被 升级
--> 正在处理依赖关系 libselinux(x86-64) = 2.5-6.el7,它被软件包 libselinux-python-2.5-6.el7.x86_64 需要
---> 软件包 libselinux.x86_64.0.2.5-14.1.el7 将被 更新
---> 软件包 libsemanage-python.x86_64.0.2.5-4.el7 将被 升级
---> 软件包 libsemanage-python.x86_64.0.2.5-14.el7 将被 更新
---> 软件包 setools-libs.x86_64.0.3.3.8-1.1.el7 将被 升级
---> 软件包 setools-libs.x86_64.0.3.3.8-4.el7 将被 更新
--> 正在检查事务
---> 软件包 libselinux-python.x86_64.0.2.5-6.el7 将被 升级
---> 软件包 libselinux-python.x86_64.0.2.5-14.1.el7 将被 更新
--> 解决依赖关系完成
依赖关系解决
=============================================================================================================================================================================================
Package 架构 版本 源 大小
=============================================================================================================================================================================================
正在安装:
docker x86_64 2:1.13.1-109.gitcccb291.el7.centos Aliyun_7.0_extras 18 M
为依赖而安装:
PyYAML x86_64 3.10-11.el7 Aliyun_7.0_base 153 k
atomic-registries x86_64 1:1.22.1-29.gitb507039.el7 Aliyun_7.0_extras 35 k
container-selinux noarch 2:2.107-3.el7 Aliyun_7.0_extras 39 k
container-storage-setup noarch 0.11.0-2.git5eaf76c.el7 Aliyun_7.0_extras 35 k
containers-common x86_64 1:0.1.37-3.el7.centos Aliyun_7.0_extras 21 k
docker-client x86_64 2:1.13.1-109.gitcccb291.el7.centos Aliyun_7.0_extras 3.9 M
docker-common x86_64 2:1.13.1-109.gitcccb291.el7.centos Aliyun_7.0_extras 98 k
oci-register-machine x86_64 1:0-6.git2b44233.el7 Aliyun_7.0_extras 1.1 M
oci-systemd-hook x86_64 1:0.2.0-1.git05e6923.el7_6 Aliyun_7.0_extras 34 k
oci-umount x86_64 2:2.5-3.el7 Aliyun_7.0_extras 33 k
python-pytoml noarch 0.1.14-1.git7dea353.el7 Aliyun_7.0_extras 18 k
subscription-manager-rhsm-certificates x86_64 1.24.13-4.el7.centos Aliyun_7.0_updates 228 k
为依赖而更新:
libselinux x86_64 2.5-14.1.el7 Aliyun_7.0_base 162 k
libselinux-python x86_64 2.5-14.1.el7 Aliyun_7.0_base 235 k
libselinux-utils x86_64 2.5-14.1.el7 Aliyun_7.0_base 151 k
libsemanage x86_64 2.5-14.el7 Aliyun_7.0_base 151 k
libsemanage-python x86_64 2.5-14.el7 Aliyun_7.0_base 113 k
libsepol x86_64 2.5-10.el7 Aliyun_7.0_base 297 k
policycoreutils x86_64 2.5-33.el7 Aliyun_7.0_base 916 k
policycoreutils-python x86_64 2.5-33.el7 Aliyun_7.0_base 457 k
selinux-policy noarch 3.13.1-252.el7_7.6 Aliyun_7.0_updates 492 k
selinux-policy-targeted noarch 3.13.1-252.el7_7.6 Aliyun_7.0_updates 7.0 M
setools-libs x86_64 3.3.8-4.el7 Aliyun_7.0_base 620 k
事务概要
=============================================================================================================================================================================================
安装 1 软件包 (+12 依赖软件包)
升级 ( 11 依赖软件包)
总下载量:34 M
Downloading packages:
No Presto metadata available for Aliyun_7.0_updates
No Presto metadata available for Aliyun_7.0_base
(1/24): atomic-registries-1.22.1-29.gitb507039.el7.x86_64.rpm | 35 kB 00:00:00
(2/24): container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch.rpm | 35 kB 00:00:00
(3/24): PyYAML-3.10-11.el7.x86_64.rpm | 153 kB 00:00:00
(4/24): container-selinux-2.107-3.el7.noarch.rpm | 39 kB 00:00:00
(5/24): containers-common-0.1.37-3.el7.centos.x86_64.rpm | 21 kB 00:00:00
(6/24): docker-client-1.13.1-109.gitcccb291.el7.centos.x86_64.rpm | 3.9 MB 00:00:00
(7/24): docker-common-1.13.1-109.gitcccb291.el7.centos.x86_64.rpm | 98 kB 00:00:00
(8/24): docker-1.13.1-109.gitcccb291.el7.centos.x86_64.rpm | 18 MB 00:00:00
(9/24): libselinux-2.5-14.1.el7.x86_64.rpm | 162 kB 00:00:00
(10/24): libselinux-python-2.5-14.1.el7.x86_64.rpm | 235 kB 00:00:00
(11/24): libselinux-utils-2.5-14.1.el7.x86_64.rpm | 151 kB 00:00:00
(12/24): libsemanage-python-2.5-14.el7.x86_64.rpm | 113 kB 00:00:00
(13/24): libsepol-2.5-10.el7.x86_64.rpm | 297 kB 00:00:00
(14/24): libsemanage-2.5-14.el7.x86_64.rpm | 151 kB 00:00:00
(15/24): oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64.rpm | 34 kB 00:00:00
(16/24): oci-umount-2.5-3.el7.x86_64.rpm | 33 kB 00:00:00
(17/24): oci-register-machine-0-6.git2b44233.el7.x86_64.rpm | 1.1 MB 00:00:00
(18/24): python-pytoml-0.1.14-1.git7dea353.el7.noarch.rpm | 18 kB 00:00:00
(19/24): policycoreutils-2.5-33.el7.x86_64.rpm | 916 kB 00:00:00
(20/24): policycoreutils-python-2.5-33.el7.x86_64.rpm | 457 kB 00:00:00
(21/24): selinux-policy-3.13.1-252.el7_7.6.noarch.rpm | 492 kB 00:00:00
(22/24): setools-libs-3.3.8-4.el7.x86_64.rpm | 620 kB 00:00:00
(23/24): subscription-manager-rhsm-certificates-1.24.13-4.el7.centos.x86_64.rpm | 228 kB 00:00:00
(24/24): selinux-policy-targeted-3.13.1-252.el7_7.6.noarch.rpm | 7.0 MB 00:00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 34 MB/s | 34 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : libsepol-2.5-10.el7.x86_64 1/35
正在更新 : libselinux-2.5-14.1.el7.x86_64 2/35
正在更新 : libsemanage-2.5-14.el7.x86_64 3/35
正在更新 : libselinux-utils-2.5-14.1.el7.x86_64 4/35
正在更新 : policycoreutils-2.5-33.el7.x86_64 5/35
正在更新 : selinux-policy-3.13.1-252.el7_7.6.noarch 6/35
正在更新 : selinux-policy-targeted-3.13.1-252.el7_7.6.noarch 7/35
正在更新 : libsemanage-python-2.5-14.el7.x86_64 8/35
正在更新 : setools-libs-3.3.8-4.el7.x86_64 9/35
正在安装 : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 10/35
正在更新 : libselinux-python-2.5-14.1.el7.x86_64 11/35
正在更新 : policycoreutils-python-2.5-33.el7.x86_64 12/35
正在安装 : 2:container-selinux-2.107-3.el7.noarch 13/35
setsebool: SELinux is disabled.
正在安装 : PyYAML-3.10-11.el7.x86_64 14/35
正在安装 : subscription-manager-rhsm-certificates-1.24.13-4.el7.centos.x86_64 15/35
正在安装 : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 16/35
正在安装 : python-pytoml-0.1.14-1.git7dea353.el7.noarch 17/35
正在安装 : 1:atomic-registries-1.22.1-29.gitb507039.el7.x86_64 18/35
正在安装 : 2:oci-umount-2.5-3.el7.x86_64 19/35
正在安装 : 1:containers-common-0.1.37-3.el7.centos.x86_64 20/35
正在安装 : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 21/35
正在安装 : 2:docker-common-1.13.1-109.gitcccb291.el7.centos.x86_64 22/35
正在安装 : 2:docker-client-1.13.1-109.gitcccb291.el7.centos.x86_64 23/35
正在安装 : 2:docker-1.13.1-109.gitcccb291.el7.centos.x86_64 24/35
清理 : policycoreutils-python-2.5-8.el7.x86_64 25/35
清理 : selinux-policy-targeted-3.13.1-102.el7.noarch 26/35
清理 : selinux-policy-3.13.1-102.el7.noarch 27/35
清理 : policycoreutils-2.5-8.el7.x86_64 28/35
清理 : libselinux-utils-2.5-6.el7.x86_64 29/35
清理 : setools-libs-3.3.8-1.1.el7.x86_64 30/35
清理 : libselinux-python-2.5-6.el7.x86_64 31/35
清理 : libsemanage-python-2.5-4.el7.x86_64 32/35
清理 : libsemanage-2.5-4.el7.x86_64 33/35
清理 : libselinux-2.5-6.el7.x86_64 34/35
清理 : libsepol-2.5-6.el7.x86_64 35/35
验证中 : 2:container-selinux-2.107-3.el7.noarch 1/35
验证中 : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 2/35
验证中 : 1:atomic-registries-1.22.1-29.gitb507039.el7.x86_64 3/35
验证中 : 2:docker-common-1.13.1-109.gitcccb291.el7.centos.x86_64 4/35
验证中 : 2:docker-1.13.1-109.gitcccb291.el7.centos.x86_64 5/35
验证中 : selinux-policy-3.13.1-252.el7_7.6.noarch 6/35
验证中 : 1:containers-common-0.1.37-3.el7.centos.x86_64 7/35
验证中 : 2:oci-umount-2.5-3.el7.x86_64 8/35
验证中 : 2:docker-client-1.13.1-109.gitcccb291.el7.centos.x86_64 9/35
验证中 : python-pytoml-0.1.14-1.git7dea353.el7.noarch 10/35
验证中 : setools-libs-3.3.8-4.el7.x86_64 11/35
验证中 : policycoreutils-python-2.5-33.el7.x86_64 12/35
验证中 : libsemanage-python-2.5-14.el7.x86_64 13/35
验证中 : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 14/35
验证中 : libsemanage-2.5-14.el7.x86_64 15/35
验证中 : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 16/35
验证中 : libsepol-2.5-10.el7.x86_64 17/35
验证中 : policycoreutils-2.5-33.el7.x86_64 18/35
验证中 : libselinux-python-2.5-14.1.el7.x86_64 19/35
验证中 : libselinux-utils-2.5-14.1.el7.x86_64 20/35
验证中 : selinux-policy-targeted-3.13.1-252.el7_7.6.noarch 21/35
验证中 : subscription-manager-rhsm-certificates-1.24.13-4.el7.centos.x86_64 22/35
验证中 : PyYAML-3.10-11.el7.x86_64 23/35
验证中 : libselinux-2.5-14.1.el7.x86_64 24/35
验证中 : policycoreutils-2.5-8.el7.x86_64 25/35
验证中 : libselinux-utils-2.5-6.el7.x86_64 26/35
验证中 : libsepol-2.5-6.el7.x86_64 27/35
验证中 : libselinux-python-2.5-6.el7.x86_64 28/35
验证中 : libsemanage-python-2.5-4.el7.x86_64 29/35
验证中 : policycoreutils-python-2.5-8.el7.x86_64 30/35
验证中 : selinux-policy-3.13.1-102.el7.noarch 31/35
验证中 : libselinux-2.5-6.el7.x86_64 32/35
验证中 : selinux-policy-targeted-3.13.1-102.el7.noarch 33/35
验证中 : libsemanage-2.5-4.el7.x86_64 34/35
验证中 : setools-libs-3.3.8-1.1.el7.x86_64 35/35
已安装:
docker.x86_64 2:1.13.1-109.gitcccb291.el7.centos
作为依赖被安装:
PyYAML.x86_64 0:3.10-11.el7 atomic-registries.x86_64 1:1.22.1-29.gitb507039.el7 container-selinux.noarch 2:2.107-3.el7
container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7 containers-common.x86_64 1:0.1.37-3.el7.centos docker-client.x86_64 2:1.13.1-109.gitcccb291.el7.centos
docker-common.x86_64 2:1.13.1-109.gitcccb291.el7.centos oci-register-machine.x86_64 1:0-6.git2b44233.el7 oci-systemd-hook.x86_64 1:0.2.0-1.git05e6923.el7_6
oci-umount.x86_64 2:2.5-3.el7 python-pytoml.noarch 0:0.1.14-1.git7dea353.el7 subscription-manager-rhsm-certificates.x86_64 0:1.24.13-4.el7.centos
作为依赖被升级:
libselinux.x86_64 0:2.5-14.1.el7 libselinux-python.x86_64 0:2.5-14.1.el7 libselinux-utils.x86_64 0:2.5-14.1.el7 libsemanage.x86_64 0:2.5-14.el7
libsemanage-python.x86_64 0:2.5-14.el7 libsepol.x86_64 0:2.5-10.el7 policycoreutils.x86_64 0:2.5-33.el7 policycoreutils-python.x86_64 0:2.5-33.el7
selinux-policy.noarch 0:3.13.1-252.el7_7.6 selinux-policy-targeted.noarch 0:3.13.1-252.el7_7.6 setools-libs.x86_64 0:3.3.8-4.el7
完毕!
3、启动docker
命令:systemctl start docker
查看docker状态: systemctl status docker
[root@master tools]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since 五 2020-05-22 10:08:46 CST; 24s ago
Docs: http://docs.docker.com
Main PID: 127460 (dockerd-current)
CGroup: /system.slice/docker.service
├─127460 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --user...
└─127474 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/...
5月 22 10:08:45 master dockerd-current[127460]: time="2020-05-22T10:08:45.909728481+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
5月 22 10:08:45 master dockerd-current[127460]: time="2020-05-22T10:08:45.910489682+08:00" level=info msg="Loading containers: start."
5月 22 10:08:45 master dockerd-current[127460]: time="2020-05-22T10:08:45.939279744+08:00" level=info msg="Firewalld running: false"
5月 22 10:08:46 master dockerd-current[127460]: time="2020-05-22T10:08:46.011047816+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/...IP address"
5月 22 10:08:46 master dockerd-current[127460]: time="2020-05-22T10:08:46.039838135+08:00" level=info msg="Loading containers: done."
5月 22 10:08:46 master dockerd-current[127460]: time="2020-05-22T10:08:46.042015081+08:00" level=warning msg="Not using native diff for overlay2, this may cause degraded perf...ter to fix"
5月 22 10:08:46 master dockerd-current[127460]: time="2020-05-22T10:08:46.051362864+08:00" level=info msg="Daemon has completed initialization"
5月 22 10:08:46 master dockerd-current[127460]: time="2020-05-22T10:08:46.051429082+08:00" level=info msg="Docker daemon" commit="cccb291/1.13.1" graphdriver=overlay2 version=1.13.1
5月 22 10:08:46 master systemd[1]: Started Docker Application Container Engine.
5月 22 10:08:46 master dockerd-current[127460]: time="2020-05-22T10:08:46.062404762+08:00" level=info msg="API listen on /var/run/docker.sock"
Hint: Some lines were ellipsized, use -l to show in full.
4、查看docker版本
命令:docker version
[root@master tools]# docker version
Client:
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-109.gitcccb291.el7.centos.x86_64
Go version: go1.10.3
Git commit: cccb291/1.13.1
Built: Tue Mar 3 17:21:24 2020
OS/Arch: linux/amd64
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.1-109.gitcccb291.el7.centos.x86_64
Go version: go1.10.3
Git commit: cccb291/1.13.1
Built: Tue Mar 3 17:21:24 2020
OS/Arch: linux/amd64
Experimental: false
5、配置开机自启动
参考资料:https://blog.csdn.net/wang123459/article/details/79063703
命令:systemctl enable docker.service
[root@master tools]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
6、docker容器与宿主服务器时间同步
通过date命令查看时间
查看主机时间
[root@master ~]# date
2020年 06月 03日 星期三 09:44:56 CST
[root@localhost ~]# date 2016年 07月 27日 星期三 22:42:44 CST
查看容器时间
bash-4.4# date
Wed Jun 3 01:09:19 UTC 2020
root@b43340ecf5ef:/#date Wed Jul 27 14:43:31 UTC 2016
可以发现,他们相隔了8小时。
CST应该是指(China Shanghai Time,东八区时间)
UTC应该是指(Coordinated Universal Time,标准时间)
使用命令:docker cp /etc/localtime <container_id>:/etc/
将配置文件localtime复制到容器中。