📖

Oracle Linux8にDockerをインストールしてみる

2022/04/15に公開約14,400字

はじめに

Oracle Linuxは構築済みです。スペックはFreeTierです。

Oracle Linuxの概要

NAME="Oracle Linux Server"
VERSION="8.5"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.5"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:5:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.5
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.5

Dockerのインストール

OSを最新に保つ

yum update -y
yum upgrade -y

旧バージョンのアンインストール

[opc@oracle-linux ~]$ sudo yum remove docker docker-client docker-client-latest
docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engi
ne
No match for argument: docker
No match for argument: docker-client
No match for argument: docker-client-latest
No match for argument: docker-common
No match for argument: docker-latest
No match for argument: docker-latest-logrotate
No match for argument: docker-logrotate
No match for argument: docker-engine
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!
[opc@oracle-linux ~]$

その他必要なモジュールのインストール

[root@oracle-linux ~]# dnf install -y dnf-utils zip unzip
Last metadata expiration check: 0:20:03 ago on Fri 15 Apr 2022 02:29:37 AM GMT.
Package yum-utils-4.0.21-4.0.1.el8_5.noarch is already installed.
Package zip-3.0-23.el8.x86_64 is already installed.
Package unzip-6.0-45.el8_4.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@oracle-linux ~]#

リポジトリのインストール

[root@oracle-linux ~]# dnf config-manager --add-repo=https://download.docker.com/linux/centos/d
ocker-ce.repo
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo

DOCKER CE のインストール

[root@oracle-linux ~]# dnf install -y docker-ce --nobest
Docker CE Stable - x86_64                                             211 kB/s |  23 kB     00:00
Dependencies resolved.
======================================================================================================
 Package                     Arch   Version                                   Repository         Size
======================================================================================================
Installing:
 docker-ce                   x86_64 3:20.10.14-3.el8                          docker-ce-stable   22 M
Installing dependencies:
 container-selinux           noarch 2:2.173.0-1.module+el8.5.0+20494+0311868c ol8_appstream      57 k
 containerd.io               x86_64 1.5.11-3.1.el8                            docker-ce-stable   29 M
 docker-ce-cli               x86_64 1:20.10.14-3.el8                          docker-ce-stable   30 M
 docker-ce-rootless-extras   x86_64 20.10.14-3.el8                            docker-ce-stable  4.6 M
 docker-scan-plugin          x86_64 0.17.0-3.el8                              docker-ce-stable  3.8 M
 fuse-common                 x86_64 3.2.1-12.0.3.el8                          ol8_baseos_latest  22 k
 fuse-overlayfs              x86_64 1.8-1.module+el8.5.0+20494+0311868c       ol8_appstream      73 k
 fuse3                       x86_64 3.2.1-12.0.3.el8                          ol8_baseos_latest  51 k
 fuse3-libs                  x86_64 3.2.1-12.0.3.el8                          ol8_baseos_latest  95 k
 libcgroup                   x86_64 0.41-19.el8                               ol8_baseos_latest  70 k
 libslirp                    x86_64 4.4.0-1.module+el8.5.0+20416+d687fed7     ol8_appstream      70 k
 policycoreutils-python-utils
                             noarch 2.9-16.0.1.el8                            ol8_baseos_latest 252 k
 slirp4netns                 x86_64 1.1.8-1.module+el8.5.0+20416+d687fed7     ol8_appstream      51 k
Enabling module streams:
 container-tools                    ol8

Transaction Summary
======================================================================================================
Install  14 Packages

Total download size: 90 M
Installed size: 374 M
Downloading Packages:
(1/14): containerd.io-1.5.11-3.1.el8.x86_64.rpm                        17 MB/s |  29 MB     00:01
(2/14): docker-ce-cli-20.10.14-3.el8.x86_64.rpm                        16 MB/s |  30 MB     00:01
(3/14): docker-ce-rootless-extras-20.10.14-3.el8.x86_64.rpm            11 MB/s | 4.6 MB     00:00
(4/14): docker-scan-plugin-0.17.0-3.el8.x86_64.rpm                     14 MB/s | 3.8 MB     00:00
(5/14): fuse-common-3.2.1-12.0.3.el8.x86_64.rpm                       158 kB/s |  22 kB     00:00
(6/14): fuse3-3.2.1-12.0.3.el8.x86_64.rpm                             520 kB/s |  51 kB     00:00
(7/14): docker-ce-20.10.14-3.el8.x86_64.rpm                           8.2 MB/s |  22 MB     00:02
(8/14): libcgroup-0.41-19.el8.x86_64.rpm                              196 kB/s |  70 kB     00:00
(9/14): fuse3-libs-3.2.1-12.0.3.el8.x86_64.rpm                        230 kB/s |  95 kB     00:00
(10/14): policycoreutils-python-utils-2.9-16.0.1.el8.noarch.rpm       3.1 MB/s | 252 kB     00:00
(11/14): fuse-overlayfs-1.8-1.module+el8.5.0+20494+0311868c.x86_64.rp 1.0 MB/s |  73 kB     00:00
(12/14): libslirp-4.4.0-1.module+el8.5.0+20416+d687fed7.x86_64.rpm    3.3 MB/s |  70 kB     00:00
(13/14): container-selinux-2.173.0-1.module+el8.5.0+20494+0311868c.no 613 kB/s |  57 kB     00:00
(14/14): slirp4netns-1.1.8-1.module+el8.5.0+20416+d687fed7.x86_64.rpm 583 kB/s |  51 kB     00:00
------------------------------------------------------------------------------------------------------
Total                                                                  32 MB/s |  90 MB     00:02
Docker CE Stable - x86_64                                              22 kB/s | 1.6 kB     00:00
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
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                              1/1
  Installing       : docker-scan-plugin-0.17.0-3.el8.x86_64                                      1/14
  Running scriptlet: docker-scan-plugin-0.17.0-3.el8.x86_64                                      1/14
  Installing       : docker-ce-cli-1:20.10.14-3.el8.x86_64                                       2/14
  Running scriptlet: docker-ce-cli-1:20.10.14-3.el8.x86_64                                       2/14
  Installing       : libslirp-4.4.0-1.module+el8.5.0+20416+d687fed7.x86_64                       3/14
  Installing       : slirp4netns-1.1.8-1.module+el8.5.0+20416+d687fed7.x86_64                    4/14
  Installing       : policycoreutils-python-utils-2.9-16.0.1.el8.noarch                          5/14
  Running scriptlet: container-selinux-2:2.173.0-1.module+el8.5.0+20494+0311868c.noarch          6/14
  Installing       : container-selinux-2:2.173.0-1.module+el8.5.0+20494+0311868c.noarch          6/14
  Running scriptlet: container-selinux-2:2.173.0-1.module+el8.5.0+20494+0311868c.noarch          6/14
  Installing       : containerd.io-1.5.11-3.1.el8.x86_64                                         7/14
  Running scriptlet: containerd.io-1.5.11-3.1.el8.x86_64                                         7/14
  Running scriptlet: libcgroup-0.41-19.el8.x86_64                                                8/14
  Installing       : libcgroup-0.41-19.el8.x86_64                                                8/14
  Running scriptlet: libcgroup-0.41-19.el8.x86_64                                                8/14
  Installing       : fuse3-libs-3.2.1-12.0.3.el8.x86_64                                          9/14
  Running scriptlet: fuse3-libs-3.2.1-12.0.3.el8.x86_64                                          9/14
  Installing       : fuse-common-3.2.1-12.0.3.el8.x86_64                                        10/14
  Installing       : fuse3-3.2.1-12.0.3.el8.x86_64                                              11/14
  Installing       : fuse-overlayfs-1.8-1.module+el8.5.0+20494+0311868c.x86_64                  12/14
  Running scriptlet: fuse-overlayfs-1.8-1.module+el8.5.0+20494+0311868c.x86_64                  12/14
  Installing       : docker-ce-rootless-extras-20.10.14-3.el8.x86_64                            13/14
  Running scriptlet: docker-ce-rootless-extras-20.10.14-3.el8.x86_64                            13/14
  Installing       : docker-ce-3:20.10.14-3.el8.x86_64                                          14/14
  Running scriptlet: docker-ce-3:20.10.14-3.el8.x86_64                                          14/14
  Running scriptlet: container-selinux-2:2.173.0-1.module+el8.5.0+20494+0311868c.noarch         14/14
  Running scriptlet: docker-ce-3:20.10.14-3.el8.x86_64                                          14/14
  Verifying        : containerd.io-1.5.11-3.1.el8.x86_64                                         1/14
  Verifying        : docker-ce-3:20.10.14-3.el8.x86_64                                           2/14
  Verifying        : docker-ce-cli-1:20.10.14-3.el8.x86_64                                       3/14
  Verifying        : docker-ce-rootless-extras-20.10.14-3.el8.x86_64                             4/14
  Verifying        : docker-scan-plugin-0.17.0-3.el8.x86_64                                      5/14
  Verifying        : fuse-common-3.2.1-12.0.3.el8.x86_64                                         6/14
  Verifying        : fuse3-3.2.1-12.0.3.el8.x86_64                                               7/14
  Verifying        : fuse3-libs-3.2.1-12.0.3.el8.x86_64                                          8/14
  Verifying        : libcgroup-0.41-19.el8.x86_64                                                9/14
  Verifying        : policycoreutils-python-utils-2.9-16.0.1.el8.noarch                         10/14
  Verifying        : container-selinux-2:2.173.0-1.module+el8.5.0+20494+0311868c.noarch         11/14
  Verifying        : fuse-overlayfs-1.8-1.module+el8.5.0+20494+0311868c.x86_64                  12/14
  Verifying        : libslirp-4.4.0-1.module+el8.5.0+20416+d687fed7.x86_64                      13/14
  Verifying        : slirp4netns-1.1.8-1.module+el8.5.0+20416+d687fed7.x86_64                   14/14

Installed:
  container-selinux-2:2.173.0-1.module+el8.5.0+20494+0311868c.noarch
  containerd.io-1.5.11-3.1.el8.x86_64
  docker-ce-3:20.10.14-3.el8.x86_64
  docker-ce-cli-1:20.10.14-3.el8.x86_64
  docker-ce-rootless-extras-20.10.14-3.el8.x86_64
  docker-scan-plugin-0.17.0-3.el8.x86_64
  fuse-common-3.2.1-12.0.3.el8.x86_64
  fuse-overlayfs-1.8-1.module+el8.5.0+20494+0311868c.x86_64
  fuse3-3.2.1-12.0.3.el8.x86_64
  fuse3-libs-3.2.1-12.0.3.el8.x86_64
  libcgroup-0.41-19.el8.x86_64
  libslirp-4.4.0-1.module+el8.5.0+20416+d687fed7.x86_64
  policycoreutils-python-utils-2.9-16.0.1.el8.noarch
  slirp4netns-1.1.8-1.module+el8.5.0+20416+d687fed7.x86_64

Complete!

dockerの起動

[root@oracle-linux ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com
[root@oracle-linux ~]# systemctl start docker
[root@oracle-linux ~]# 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 Fri 2022-04-15 03:13:23 GMT; 1s ago
     Docs: https://docs.docker.com
 Main PID: 13979 (dockerd)
    Tasks: 8
   Memory: 94.6M
   CGroup: /system.slice/docker.service
           mq13979 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Apr 15 03:13:17 oracle-linux dockerd[13979]: time="2022-04-15T03:13:17.385173449Z" level=warni>
Apr 15 03:13:17 oracle-linux dockerd[13979]: time="2022-04-15T03:13:17.387403632Z" level=info >
Apr 15 03:13:21 oracle-linux dockerd[13979]: time="2022-04-15T03:13:21.605179435Z" level=info >
Apr 15 03:13:22 oracle-linux dockerd[13979]: time="2022-04-15T03:13:22.104739721Z" level=info >
Apr 15 03:13:22 oracle-linux dockerd[13979]: time="2022-04-15T03:13:22.587164200Z" level=info >
Apr 15 03:13:23 oracle-linux dockerd[13979]: time="2022-04-15T03:13:23.074562959Z" level=warni>
Apr 15 03:13:23 oracle-linux dockerd[13979]: time="2022-04-15T03:13:23.074996939Z" level=info >
Apr 15 03:13:23 oracle-linux dockerd[13979]: time="2022-04-15T03:13:23.076170917Z" level=info >
Apr 15 03:13:23 oracle-linux systemd[1]: Started Docker Application Container Engine.
Apr 15 03:13:23 oracle-linux dockerd[13979]: time="2022-04-15T03:13:23.289822830Z" level=info >
[root@oracle-linux ~]#

info情報

[root@oracle-linux ~]# docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.8.1-docker)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.14
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3df54a852345ae127d1fa3092b95168e4a88e2f8
 runc version: v1.0.3-0-gf46b6ba
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.4.17-2136.306.1.3.el8uek.x86_64
 Operating System: Oracle Linux Server 8.5
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 682.7MiB
 Name: oracle-linux
 ID: CFPC:X4AC:YELO:YCUL:GS23:PJUY:4QSJ:SDTD:YSPK:VXFP:QV7A:7PET
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

バージョン情報

[root@oracle-linux ~]# docker --version
Docker version 20.10.14, build a224086

Discussion

ログインするとコメントできます