Oracle Linux上にDockerをインストール

参考にしたのは以下のブログ  
[Install Docker on Oracle Linux 7](https://blogs.oracle.com/virtualization/install-docker-on-oracle-linux-7-v2)

#### 実行環境
Oracle Linux Server release 7.5

#### yum の設定
```
# cd /etc/yum.repos.d/
# wget http://yum.oracle.com/public-yum-ol7.repo
# vi public-yum-ol7.repo

[ol7_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol7_UEKR5]
name=Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux $releasever ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/UEKR5/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol7_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
```


#### yumでdocker-engineをインストール

```
# yum install docker-engine
Loaded plugins: langpacks, ulninfo
ksplice-uptrack                                                                                       |  951 B  00:00:00
ol7_UEKR5                                                                                             | 1.2 kB  00:00:00
ol7_addons                                                                                            | 1.2 kB  00:00:00
ol7_developer                                                                                         | 1.2 kB  00:00:00
ol7_developer_EPEL                                                                                    | 1.2 kB  00:00:00
ol7_latest                                                                                            | 1.4 kB  00:00:00
ol7_optional_latest                                                                                   | 1.2 kB  00:00:00
ol7_software_collections                                                                              | 1.2 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package docker-engine.x86_64 0:18.03.1.ol-0.0.9.el7 will be installed
--> Processing Dependency: container-selinux >= 2.9 for package: docker-engine-18.03.1.ol-0.0.9.el7.x86_64
--> Processing Dependency: pigz for package: docker-engine-18.03.1.ol-0.0.9.el7.x86_64
--> Processing Dependency: libltdl.so.7()(64bit) for package: docker-engine-18.03.1.ol-0.0.9.el7.x86_64
--> Running transaction check
---> Package container-selinux.noarch 2:2.21-1.el7 will be installed
---> Package libtool-ltdl.x86_64 0:2.4.2-22.el7_3 will be installed
---> Package pigz.x86_64 0:2.3.4-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                          Arch                  Version                              Repository                 Size
=============================================================================================================================
Installing:
 docker-engine                    x86_64                18.03.1.ol-0.0.9.el7                 ol7_addons                 35 M
Installing for dependencies:
 container-selinux                noarch                2:2.21-1.el7                         ol7_addons                 28 k
 libtool-ltdl                     x86_64                2.4.2-22.el7_3                       ol7_latest                 48 k
 pigz                             x86_64                2.3.4-1.el7                          ol7_addons                 80 k

Transaction Summary
=============================================================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 35 M
Installed size: 151 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): container-selinux-2.21-1.el7.noarch.rpm                                                        |  28 kB  00:00:00
(2/4): pigz-2.3.4-1.el7.x86_64.rpm                                                                    |  80 kB  00:00:00
(3/4): docker-engine-18.03.1.ol-0.0.9.el7.x86_64.rpm                                                  |  35 MB  00:00:02
(4/4): libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm                                                         |  48 kB  00:00:02
-----------------------------------------------------------------------------------------------------------------------------
Total                                                                                         13 MB/s |  35 MB  00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:container-selinux-2.21-1.el7.noarch                                                                     1/4
  Installing : libtool-ltdl-2.4.2-22.el7_3.x86_64                                                                        2/4
  Installing : pigz-2.3.4-1.el7.x86_64                                                                                   3/4
  Installing : docker-engine-18.03.1.ol-0.0.9.el7.x86_64                                                                 4/4
xfs_info: /var/lib is not a mounted XFS filesystem
  Verifying  : pigz-2.3.4-1.el7.x86_64                                                                                   1/4
  Verifying  : libtool-ltdl-2.4.2-22.el7_3.x86_64                                                                        2/4
  Verifying  : docker-engine-18.03.1.ol-0.0.9.el7.x86_64                                                                 3/4
  Verifying  : 2:container-selinux-2.21-1.el7.noarch                                                                     4/4

Installed:
  docker-engine.x86_64 0:18.03.1.ol-0.0.9.el7

Dependency Installed:
  container-selinux.noarch 2:2.21-1.el7        libtool-ltdl.x86_64 0:2.4.2-22.el7_3        pigz.x86_64 0:2.3.4-1.el7

Complete!
```

#### docker serviceの起動  
systemctlに未だに慣れない(笑)

```
# systemctl start docker
# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/docker.service.d
           └─docker-sysconfig.conf
   Active: active (running) since Wed 2018-11-14 13:16:51 GMT; 25min ago
     Docs: https://docs.docker.com
 Main PID: 3409 (dockerd)
    Tasks: 18
   Memory: 40.8M
   CGroup: /system.slice/docker.service
           ├─3409 /usr/bin/dockerd --selinux-enabled
           └─3414 docker-containerd --config /var/run/docker/containerd/containerd.toml
...
```

#### Container Registry
[Oracle Container Registry](https://container-registry.oracle.com/pls/apex/f?p=113:10::::::)  
Blogでは上記のようなContainer Registryも紹介されていたが、まだ使い方がよく分かっていない。  
たぶんここらへんを読めばいいのだろうか  
[Oracle Container Runtime for Dockerユーザーズ・ガイド](https://docs.oracle.com/cd/E77565_01/E87205/html/oracle-registry-server.html)