Docker のRHEL7への導入


Docker をRHEL7に導入します。


■環境
RHEL 7.9
Docker 1.13.1-203.git0be3e21.el7_9

## 前提環境の準備

導入のためにはRed Hat Enterprise Linux 7 Server - Extras (RPMs)を有効にする必要があります。

```bash:コマンド
sudo subscription-manager repos --enable rhel-7-server-extras-rpms
yum repolist all
```

```console:結果
[root@anaconda yum.repos.d]# sudo subscription-manager repos --enable rhel-7-server-extras-rpms
Repository 'rhel-7-server-extras-rpms' is enabled for this system.
[root@anaconda yum.repos.d]# yum repolist all
Loaded plugins: product-id, search-disabled-repos, subscription-manager
repo id                                                               repo name                                                                                                          status
rhel-7-server-debug-rpms/7Server/x86_64                               Red Hat Enterprise Linux 7 Server (Debug RPMs)                                                                     disabled
rhel-7-server-eus-optional-rpms/7Server/x86_64                        Red Hat Enterprise Linux 7 Server - Extended Update Support - Optional (RPMs)                                      disabled
rhel-7-server-eus-rpms/7Server/x86_64                                 Red Hat Enterprise Linux 7 Server - Extended Update Support (RPMs)                                                 disabled
rhel-7-server-eus-supplementary-rpms/7Server/x86_64                   Red Hat Enterprise Linux 7 Server - Extended Update Support - Supplementary (RPMs)                                 disabled
!rhel-7-server-extras-rpms/x86_64                                     Red Hat Enterprise Linux 7 Server - Extras (RPMs)                                                                  enabled:  1,359
!rhel-7-server-optional-rpms/7Server/x86_64                           Red Hat Enterprise Linux 7 Server - Optional (RPMs)                                                                enabled: 22,749
rhel-7-server-rh-common-rpms/7Server/x86_64                           Red Hat Enterprise Linux 7 Server - RH Common (RPMs)                                                               disabled
!rhel-7-server-rpms/7Server/x86_64                                    Red Hat Enterprise Linux 7 Server (RPMs)                                                                           enabled: 31,446
!rhel-7-server-supplementary-rpms/7Server/x86_64                      Red Hat Enterprise Linux 7 Server - Supplementary (RPMs)                                                           enabled:    407
rhel-ha-for-rhel-7-server-eus-rpms/7Server/x86_64                     Red Hat Enterprise Linux High Availability (for RHEL 7 Server) - Extended Update Support (RPMs)                    disabled
rhel-ha-for-rhel-7-server-rpms/7Server/x86_64                         Red Hat Enterprise Linux High Availability (for RHEL 7 Server) (RPMs)                                              disabled
rhel-rs-for-rhel-7-server-eus-rpms/7Server/x86_64                     Red Hat Enterprise Linux Resilient Storage (for RHEL 7 Server) - Extended Update Support (RPMs)                    disabled
rhel-server-rhscl-7-rpms/7Server/x86_64                               Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server                                            disabled
repolist: 55,961
[root@anaconda yum.repos.d]#
```



## 導入
以下のコマンドでdockerを導入します。

```bash:コマンド
yum install docker
```
```console:結果
[root@anaconda yum.repos.d]# yum install docker
Loaded plugins: product-id, search-disabled-repos, subscription-manager
rhel-7-server-extras-rpms                                                                                                                                                        | 2.0 kB  00:00:00
rhel-7-server-optional-rpms                                                                                                                                                      | 1.8 kB  00:00:00
rhel-7-server-rpms                                                                                                                                                               | 2.0 kB  00:00:00
rhel-7-server-supplementary-rpms                                                                                                                                                 | 2.0 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 2:1.13.1-203.git0be3e21.el7_9 will be installed
--> Processing Dependency: docker-common = 2:1.13.1-203.git0be3e21.el7_9 for package: 2:docker-1.13.1-203.git0be3e21.el7_9.x86_64
--> Processing Dependency: docker-client = 2:1.13.1-203.git0be3e21.el7_9 for package: 2:docker-1.13.1-203.git0be3e21.el7_9.x86_64
--> Processing Dependency: libseccomp.so.2()(64bit) for package: 2:docker-1.13.1-203.git0be3e21.el7_9.x86_64
--> Running transaction check
---> Package docker-client.x86_64 2:1.13.1-203.git0be3e21.el7_9 will be installed
---> Package docker-common.x86_64 2:1.13.1-203.git0be3e21.el7_9 will be installed
--> Processing Dependency: docker-rhel-push-plugin = 2:1.13.1-203.git0be3e21.el7_9 for package: 2:docker-common-1.13.1-203.git0be3e21.el7_9.x86_64
--> Processing Dependency: skopeo-containers >= 1:0.1.26-2 for package: 2:docker-common-1.13.1-203.git0be3e21.el7_9.x86_64
--> Processing Dependency: oci-umount >= 2:2.3.3-3 for package: 2:docker-common-1.13.1-203.git0be3e21.el7_9.x86_64
--> Processing Dependency: oci-systemd-hook >= 1:0.1.4-9 for package: 2:docker-common-1.13.1-203.git0be3e21.el7_9.x86_64
--> Processing Dependency: oci-register-machine >= 1:0-5.13 for package: 2:docker-common-1.13.1-203.git0be3e21.el7_9.x86_64
--> Processing Dependency: lvm2 >= 2.02.112 for package: 2:docker-common-1.13.1-203.git0be3e21.el7_9.x86_64
--> Processing Dependency: container-storage-setup >= 0.9.0-1 for package: 2:docker-common-1.13.1-203.git0be3e21.el7_9.x86_64
--> Processing Dependency: container-selinux >= 2:2.51-1 for package: 2:docker-common-1.13.1-203.git0be3e21.el7_9.x86_64
--> Processing Dependency: atomic-registries for package: 2:docker-common-1.13.1-203.git0be3e21.el7_9.x86_64
---> Package libseccomp.x86_64 0:2.3.1-4.el7 will be installed
--> Running transaction check
---> Package atomic-registries.x86_64 1:1.22.1-33.gitb507039.el7_8 will be installed
--> Processing Dependency: python-pytoml for package: 1:atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64
---> Package container-selinux.noarch 2:2.119.2-1.911c772.el7_8 will be installed
---> Package container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7 will be installed
---> Package containers-common.x86_64 1:0.1.40-12.el7_9 will be installed
--> Processing Dependency: slirp4netns for package: 1:containers-common-0.1.40-12.el7_9.x86_64
--> Processing Dependency: fuse-overlayfs for package: 1:containers-common-0.1.40-12.el7_9.x86_64
---> Package docker-rhel-push-plugin.x86_64 2:1.13.1-203.git0be3e21.el7_9 will be installed
---> Package lvm2.x86_64 7:2.02.187-6.el7_9.3 will be installed
--> Processing Dependency: lvm2-libs = 7:2.02.187-6.el7_9.3 for package: 7:lvm2-2.02.187-6.el7_9.3.x86_64
--> Processing Dependency: device-mapper-persistent-data >= 0.7.0-0.1.rc6 for package: 7:lvm2-2.02.187-6.el7_9.3.x86_64
--> Processing Dependency: liblvm2app.so.2.2(Base)(64bit) for package: 7:lvm2-2.02.187-6.el7_9.3.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02(Base)(64bit) for package: 7:lvm2-2.02.187-6.el7_9.3.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: 7:lvm2-2.02.187-6.el7_9.3.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: 7:lvm2-2.02.187-6.el7_9.3.x86_64
--> Processing Dependency: liblvm2app.so.2.2()(64bit) for package: 7:lvm2-2.02.187-6.el7_9.3.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02()(64bit) for package: 7:lvm2-2.02.187-6.el7_9.3.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: 7:lvm2-2.02.187-6.el7_9.3.x86_64
---> Package oci-register-machine.x86_64 1:0-6.git2b44233.el7 will be installed
---> Package oci-systemd-hook.x86_64 1:0.2.0-1.git05e6923.el7_6 will be installed
--> Processing Dependency: libyajl.so.2()(64bit) for package: 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64
---> Package oci-umount.x86_64 2:2.5-3.el7 will be installed
--> Running transaction check
---> Package device-mapper-event-libs.x86_64 7:1.02.170-6.el7_9.3 will be installed
---> Package device-mapper-persistent-data.x86_64 0:0.8.5-3.el7_9.2 will be installed
---> Package fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 will be installed
--> Processing Dependency: libfuse3.so.3(FUSE_3.2)(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
--> Processing Dependency: libfuse3.so.3(FUSE_3.0)(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
--> Processing Dependency: libfuse3.so.3()(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package lvm2-libs.x86_64 7:2.02.187-6.el7_9.3 will be installed
--> Processing Dependency: device-mapper-event = 7:1.02.170-6.el7_9.3 for package: 7:lvm2-libs-2.02.187-6.el7_9.3.x86_64
---> Package python-pytoml.noarch 0:0.1.14-1.git7dea353.el7 will be installed
---> Package slirp4netns.x86_64 0:0.4.3-4.el7_8 will be installed
---> Package yajl.x86_64 0:2.0.4-4.el7 will be installed
--> Running transaction check
---> Package device-mapper-event.x86_64 7:1.02.170-6.el7_9.3 will be installed
--> Processing Dependency: device-mapper = 7:1.02.170-6.el7_9.3 for package: 7:device-mapper-event-1.02.170-6.el7_9.3.x86_64
---> Package fuse3-libs.x86_64 0:3.6.1-4.el7 will be installed
--> Running transaction check
---> Package device-mapper.x86_64 7:1.02.170-6.el7 will be updated
--> Processing Dependency: device-mapper = 7:1.02.170-6.el7 for package: 7:device-mapper-libs-1.02.170-6.el7.x86_64
---> Package device-mapper.x86_64 7:1.02.170-6.el7_9.3 will be an update
--> Running transaction check
---> Package device-mapper-libs.x86_64 7:1.02.170-6.el7 will be updated
---> Package device-mapper-libs.x86_64 7:1.02.170-6.el7_9.3 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================================================
 Package                                                Arch                            Version                                                Repository                                          Size
========================================================================================================================================================================================================
Installing:
 docker                                                 x86_64                          2:1.13.1-203.git0be3e21.el7_9                          rhel-7-server-extras-rpms                           18 M
Installing for dependencies:
 atomic-registries                                      x86_64                          1:1.22.1-33.gitb507039.el7_8                           rhel-7-server-extras-rpms                           36 k
 container-selinux                                      noarch                          2:2.119.2-1.911c772.el7_8                              rhel-7-server-extras-rpms                           40 k
 container-storage-setup                                noarch                          0.11.0-2.git5eaf76c.el7                                rhel-7-server-extras-rpms                           35 k
 containers-common                                      x86_64                          1:0.1.40-12.el7_9                                      rhel-7-server-extras-rpms                           44 k
 device-mapper-event                                    x86_64                          7:1.02.170-6.el7_9.3                                   rhel-7-server-rpms                                 192 k
 device-mapper-event-libs                               x86_64                          7:1.02.170-6.el7_9.3                                   rhel-7-server-rpms                                 192 k
 device-mapper-persistent-data                          x86_64                          0.8.5-3.el7_9.2                                        rhel-7-server-rpms                                 423 k
 docker-client                                          x86_64                          2:1.13.1-203.git0be3e21.el7_9                          rhel-7-server-extras-rpms                          3.9 M
 docker-common                                          x86_64                          2:1.13.1-203.git0be3e21.el7_9                          rhel-7-server-extras-rpms                          100 k
 docker-rhel-push-plugin                                x86_64                          2:1.13.1-203.git0be3e21.el7_9                          rhel-7-server-extras-rpms                          2.0 M
 fuse-overlayfs                                         x86_64                          0.7.2-6.el7_8                                          rhel-7-server-extras-rpms                           55 k
 fuse3-libs                                             x86_64                          3.6.1-4.el7                                            rhel-7-server-extras-rpms                           82 k
 libaio                                                 x86_64                          0.3.109-13.el7                                         rhel-7-server-rpms                                  24 k
 libseccomp                                             x86_64                          2.3.1-4.el7                                            rhel-7-server-rpms                                  56 k
 lvm2                                                   x86_64                          7:2.02.187-6.el7_9.3                                   rhel-7-server-rpms                                 1.3 M
 lvm2-libs                                              x86_64                          7:2.02.187-6.el7_9.3                                   rhel-7-server-rpms                                 1.1 M
 oci-register-machine                                   x86_64                          1:0-6.git2b44233.el7                                   rhel-7-server-extras-rpms                          1.1 M
 oci-systemd-hook                                       x86_64                          1:0.2.0-1.git05e6923.el7_6                             rhel-7-server-extras-rpms                           34 k
 oci-umount                                             x86_64                          2:2.5-3.el7                                            rhel-7-server-extras-rpms                           33 k
 python-pytoml                                          noarch                          0.1.14-1.git7dea353.el7                                rhel-7-server-extras-rpms                           18 k
 slirp4netns                                            x86_64                          0.4.3-4.el7_8                                          rhel-7-server-extras-rpms                           82 k
 yajl                                                   x86_64                          2.0.4-4.el7                                            rhel-7-server-rpms                                  39 k
Updating for dependencies:
 device-mapper                                          x86_64                          7:1.02.170-6.el7_9.3                                   rhel-7-server-rpms                                 297 k
 device-mapper-libs                                     x86_64                          7:1.02.170-6.el7_9.3                                   rhel-7-server-rpms                                 325 k

Transaction Summary
========================================================================================================================================================================================================
Install  1 Package  (+22 Dependent packages)
Upgrade             (  2 Dependent packages)

Total download size: 29 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for rhel-7-server-rpms
(1/25): atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64.rpm                                                                                                                  |  36 kB  00:00:00
(2/25): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm                                                                                                                     |  40 kB  00:00:00
(3/25): container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch.rpm                                                                                                               |  35 kB  00:00:00
(4/25): containers-common-0.1.40-12.el7_9.x86_64.rpm                                                                                                                             |  44 kB  00:00:00
(5/25): device-mapper-1.02.170-6.el7_9.3.x86_64.rpm                                                                                                                              | 297 kB  00:00:00
(6/25): device-mapper-event-1.02.170-6.el7_9.3.x86_64.rpm                                                                                                                        | 192 kB  00:00:00
(7/25): device-mapper-event-libs-1.02.170-6.el7_9.3.x86_64.rpm                                                                                                                   | 192 kB  00:00:00
(8/25): device-mapper-libs-1.02.170-6.el7_9.3.x86_64.rpm                                                                                                                         | 325 kB  00:00:00
(9/25): device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64.rpm                                                                                                                 | 423 kB  00:00:00
(10/25): docker-client-1.13.1-203.git0be3e21.el7_9.x86_64.rpm                                                                                                                    | 3.9 MB  00:00:01
(11/25): docker-common-1.13.1-203.git0be3e21.el7_9.x86_64.rpm                                                                                                                    | 100 kB  00:00:00
(12/25): docker-1.13.1-203.git0be3e21.el7_9.x86_64.rpm                                                                                                                           |  18 MB  00:00:02
(13/25): docker-rhel-push-plugin-1.13.1-203.git0be3e21.el7_9.x86_64.rpm                                                                                                          | 2.0 MB  00:00:00
(14/25): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm                                                                                                                                 |  55 kB  00:00:00
(15/25): fuse3-libs-3.6.1-4.el7.x86_64.rpm                                                                                                                                       |  82 kB  00:00:00
(16/25): libaio-0.3.109-13.el7.x86_64.rpm                                                                                                                                        |  24 kB  00:00:00
(17/25): libseccomp-2.3.1-4.el7.x86_64.rpm                                                                                                                                       |  56 kB  00:00:00
(18/25): oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64.rpm                                                                                                                    |  34 kB  00:00:00
(19/25): lvm2-2.02.187-6.el7_9.3.x86_64.rpm                                                                                                                                      | 1.3 MB  00:00:00
(20/25): oci-umount-2.5-3.el7.x86_64.rpm                                                                                                                                         |  33 kB  00:00:00
(21/25): lvm2-libs-2.02.187-6.el7_9.3.x86_64.rpm                                                                                                                                 | 1.1 MB  00:00:00
(22/25): oci-register-machine-0-6.git2b44233.el7.x86_64.rpm                                                                                                                      | 1.1 MB  00:00:00
(23/25): python-pytoml-0.1.14-1.git7dea353.el7.noarch.rpm                                                                                                                        |  18 kB  00:00:00
(24/25): slirp4netns-0.4.3-4.el7_8.x86_64.rpm                                                                                                                                    |  82 kB  00:00:00
(25/25): yajl-2.0.4-4.el7.x86_64.rpm                                                                                                                                             |  39 kB  00:00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                   6.7 MB/s |  29 MB  00:00:04
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libaio-0.3.109-13.el7.x86_64                                                                                                                                                        1/27
  Updating   : 7:device-mapper-libs-1.02.170-6.el7_9.3.x86_64                                                                                                                                      2/27
  Updating   : 7:device-mapper-1.02.170-6.el7_9.3.x86_64                                                                                                                                           3/27
  Installing : 7:device-mapper-event-libs-1.02.170-6.el7_9.3.x86_64                                                                                                                                4/27
  Installing : yajl-2.0.4-4.el7.x86_64                                                                                                                                                             5/27
  Installing : libseccomp-2.3.1-4.el7.x86_64                                                                                                                                                       6/27
  Installing : slirp4netns-0.4.3-4.el7_8.x86_64                                                                                                                                                    7/27
  Installing : 2:oci-umount-2.5-3.el7.x86_64                                                                                                                                                       8/27
  Installing : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64                                                                                                                                  9/27
  Installing : 7:device-mapper-event-1.02.170-6.el7_9.3.x86_64                                                                                                                                    10/27
  Installing : 7:lvm2-libs-2.02.187-6.el7_9.3.x86_64                                                                                                                                              11/27
  Installing : device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64                                                                                                                               12/27
  Installing : 7:lvm2-2.02.187-6.el7_9.3.x86_64                                                                                                                                                   13/27
  Installing : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch                                                                                                                             14/27
  Installing : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch                                                                                                                                 15/27
  Installing : 1:oci-register-machine-0-6.git2b44233.el7.x86_64                                                                                                                                   16/27
  Installing : fuse3-libs-3.6.1-4.el7.x86_64                                                                                                                                                      17/27
  Installing : fuse-overlayfs-0.7.2-6.el7_8.x86_64                                                                                                                                                18/27
  Installing : 1:containers-common-0.1.40-12.el7_9.x86_64                                                                                                                                         19/27
  Installing : python-pytoml-0.1.14-1.git7dea353.el7.noarch                                                                                                                                       20/27
  Installing : 1:atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64                                                                                                                              21/27
  Installing : 2:docker-rhel-push-plugin-1.13.1-203.git0be3e21.el7_9.x86_64                                                                                                                       22/27
  Installing : 2:docker-common-1.13.1-203.git0be3e21.el7_9.x86_64                                                                                                                                 23/27
  Installing : 2:docker-client-1.13.1-203.git0be3e21.el7_9.x86_64                                                                                                                                 24/27
  Installing : 2:docker-1.13.1-203.git0be3e21.el7_9.x86_64                                                                                                                                        25/27
  Cleanup    : 7:device-mapper-libs-1.02.170-6.el7.x86_64                                                                                                                                         26/27
  Cleanup    : 7:device-mapper-1.02.170-6.el7.x86_64                                                                                                                                              27/27
  Verifying  : 7:lvm2-2.02.187-6.el7_9.3.x86_64                                                                                                                                                    1/27
  Verifying  : 1:atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64                                                                                                                               2/27
  Verifying  : fuse-overlayfs-0.7.2-6.el7_8.x86_64                                                                                                                                                 3/27
  Verifying  : 2:docker-client-1.13.1-203.git0be3e21.el7_9.x86_64                                                                                                                                  4/27
  Verifying  : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch                                                                                                                              5/27
  Verifying  : 1:containers-common-0.1.40-12.el7_9.x86_64                                                                                                                                          6/27
  Verifying  : 7:device-mapper-event-libs-1.02.170-6.el7_9.3.x86_64                                                                                                                                7/27
  Verifying  : 2:docker-rhel-push-plugin-1.13.1-203.git0be3e21.el7_9.x86_64                                                                                                                        8/27
  Verifying  : 2:oci-umount-2.5-3.el7.x86_64                                                                                                                                                       9/27
  Verifying  : libseccomp-2.3.1-4.el7.x86_64                                                                                                                                                      10/27
  Verifying  : 7:lvm2-libs-2.02.187-6.el7_9.3.x86_64                                                                                                                                              11/27
  Verifying  : python-pytoml-0.1.14-1.git7dea353.el7.noarch                                                                                                                                       12/27
  Verifying  : libaio-0.3.109-13.el7.x86_64                                                                                                                                                       13/27
  Verifying  : 7:device-mapper-1.02.170-6.el7_9.3.x86_64                                                                                                                                          14/27
  Verifying  : 2:docker-1.13.1-203.git0be3e21.el7_9.x86_64                                                                                                                                        15/27
  Verifying  : 2:docker-common-1.13.1-203.git0be3e21.el7_9.x86_64                                                                                                                                 16/27
  Verifying  : fuse3-libs-3.6.1-4.el7.x86_64                                                                                                                                                      17/27
  Verifying  : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64                                                                                                                                 18/27
  Verifying  : 7:device-mapper-event-1.02.170-6.el7_9.3.x86_64                                                                                                                                    19/27
  Verifying  : 1:oci-register-machine-0-6.git2b44233.el7.x86_64                                                                                                                                   20/27
  Verifying  : 7:device-mapper-libs-1.02.170-6.el7_9.3.x86_64                                                                                                                                     21/27
  Verifying  : slirp4netns-0.4.3-4.el7_8.x86_64                                                                                                                                                   22/27
  Verifying  : yajl-2.0.4-4.el7.x86_64                                                                                                                                                            23/27
  Verifying  : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch                                                                                                                                 24/27
  Verifying  : device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64                                                                                                                               25/27
  Verifying  : 7:device-mapper-1.02.170-6.el7.x86_64                                                                                                                                              26/27
  Verifying  : 7:device-mapper-libs-1.02.170-6.el7.x86_64                                                                                                                                         27/27

Installed:
  docker.x86_64 2:1.13.1-203.git0be3e21.el7_9

Dependency Installed:
  atomic-registries.x86_64 1:1.22.1-33.gitb507039.el7_8                  container-selinux.noarch 2:2.119.2-1.911c772.el7_8           container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7
  containers-common.x86_64 1:0.1.40-12.el7_9                             device-mapper-event.x86_64 7:1.02.170-6.el7_9.3              device-mapper-event-libs.x86_64 7:1.02.170-6.el7_9.3
  device-mapper-persistent-data.x86_64 0:0.8.5-3.el7_9.2                 docker-client.x86_64 2:1.13.1-203.git0be3e21.el7_9           docker-common.x86_64 2:1.13.1-203.git0be3e21.el7_9
  docker-rhel-push-plugin.x86_64 2:1.13.1-203.git0be3e21.el7_9           fuse-overlayfs.x86_64 0:0.7.2-6.el7_8                        fuse3-libs.x86_64 0:3.6.1-4.el7
  libaio.x86_64 0:0.3.109-13.el7                                         libseccomp.x86_64 0:2.3.1-4.el7                              lvm2.x86_64 7:2.02.187-6.el7_9.3
  lvm2-libs.x86_64 7:2.02.187-6.el7_9.3                                  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               slirp4netns.x86_64 0:0.4.3-4.el7_8
  yajl.x86_64 0:2.0.4-4.el7

Dependency Updated:
  device-mapper.x86_64 7:1.02.170-6.el7_9.3                                                        device-mapper-libs.x86_64 7:1.02.170-6.el7_9.3

Complete!
[root@anaconda yum.repos.d]#

```

Docker 起動と確認は以下で行います。

```bash:コマンド
sudo systemctl start docker
sudo systemctl status docker
```
```console:結果
[root@anaconda yum.repos.d]# sudo 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 Mon 2021-03-15 06:39:38 CDT; 8s ago
     Docs: http://docs.docker.com
 Main PID: 114780 (dockerd-current)
   CGroup: /system.slice/docker.service
           tq114780 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --authorization-plugin=rhel-push-plugin --exec-opt nativ...
           mq114789 /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/libcontaine...

Mar 15 06:39:36 anaconda.icp4djp.cloud dockerd-current[114780]: time="2021-03-15T06:39:36.959881505-05:00" level=info msg="libcontainerd: new containerd process, pid: 114789"
Mar 15 06:39:38 anaconda.icp4djp.cloud dockerd-current[114780]: time="2021-03-15T06:39:38.052581047-05:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Mar 15 06:39:38 anaconda.icp4djp.cloud dockerd-current[114780]: time="2021-03-15T06:39:38.053938531-05:00" level=info msg="Loading containers: start."
Mar 15 06:39:38 anaconda.icp4djp.cloud dockerd-current[114780]: time="2021-03-15T06:39:38.071553870-05:00" level=info msg="Firewalld running: false"
Mar 15 06:39:38 anaconda.icp4djp.cloud dockerd-current[114780]: time="2021-03-15T06:39:38.273414454-05:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17....IP address"
Mar 15 06:39:38 anaconda.icp4djp.cloud dockerd-current[114780]: time="2021-03-15T06:39:38.351428500-05:00" level=info msg="Loading containers: done."
Mar 15 06:39:38 anaconda.icp4djp.cloud dockerd-current[114780]: time="2021-03-15T06:39:38.444275222-05:00" level=info msg="Daemon has completed initialization"
Mar 15 06:39:38 anaconda.icp4djp.cloud dockerd-current[114780]: time="2021-03-15T06:39:38.444391081-05:00" level=info msg="Docker daemon" commit="0be3e21/1.13.1" graphdriver=overlay2 version=1.13.1
Mar 15 06:39:38 anaconda.icp4djp.cloud dockerd-current[114780]: time="2021-03-15T06:39:38.458975173-05:00" level=info msg="API listen on /var/run/docker.sock"
Mar 15 06:39:38 anaconda.icp4djp.cloud systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
[root@anaconda yum.repos.d]#
```

## テスト実行

hello-worldでテストを実行します。

```bash:コマンド
sudo docker run hello-world
```
```console:結果
[root@anaconda yum.repos.d]# sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
Trying to pull repository registry.access.redhat.com/hello-world ...
Pulling repository registry.access.redhat.com/hello-world
Trying to pull repository registry.redhat.io/hello-world ...
Trying to pull repository docker.io/library/hello-world ...
latest: Pulling from docker.io/library/hello-world
b8dfde127a29: Pull complete
Digest: sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24
Status: Downloaded newer image for docker.io/hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

[root@anaconda yum.repos.d]#
```

hello worldのコンテナを削除します。

```bash:コマンド
docker ps -a
docker rm <コンテナID>
```
```console:結果
[root@anaconda yum.repos.d]# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
6a88da01f978        hello-world         "/hello"            48 seconds ago      Exited (0) 47 seconds ago                       naughty_spence
[root@anaconda yum.repos.d]# docker rm 6a88da01f978
6a88da01f978
[root@anaconda yum.repos.d]# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
[root@anaconda yum.repos.d]#
```

hello worldのイメージを削除します。

```bash:コマンド
docker images
docker rmi <イメージID>
```
```console:結果
[root@anaconda yum.repos.d]# docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
docker.io/hello-world   latest              d1165f221234        9 days ago          13.3 kB
[root@anaconda yum.repos.d]# docker rmi d1165f221234
Untagged: docker.io/hello-world:latest
Untagged: docker.io/hello-world@sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24
Deleted: sha256:d1165f2212346b2bab48cb01c1e39ee8ad1be46b87873d9ca7a4e434980a7726
Deleted: sha256:f22b99068db93900abe17f7f5e09ec775c2826ecfe9db961fea68293744144bd
[root@anaconda yum.repos.d]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
[root@anaconda yum.repos.d]#
```

## Docker をブート時に自動起動する
DockerをOSブート時に起動する場合には以下で設定が可能です。

```bash:コマンド
sudo systemctl enable docker
```
```console:結果
[root@anaconda yum.repos.d]# sudo systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@anaconda yum.repos.d]#
```

＜参考＞systemd で Docker の管理・設定 — Docker-docs-ja 1.11.0 ドキュメント <BR>
http://docs.docker.jp/v1.11/engine/admin/systemd.html

## 参考情報

https://access.redhat.com/articles/2317361