いろいろやってみるにっき

てきとーに生きている奴の日記

古いエントリのサムネイル画像がリンク切れになってたりするけど、チマチマ修正中


Oracle Linux 8.5のVMでDockerを動かす

前回作成したVMOracle Linux

 

shigeo-t.hatenablog.com

 

OSの準備ができたのでDockerを動かす。手順はこちら。

souiunogaii.hatenablog.com

 

実行してみたらあっさり動いた。これでWSL2のOracle Linuxでも頑張って動かすモチベーションが出た。

[shigeotsukuta@localhost ~]$ sudo dnf update -y

あなたはシステム管理者から通常の講習を受けたはずです。
これは通常、以下の3点に要約されます:

    #1) 他人のプライバシーを尊重すること。
    #2) タイプする前に考えること。
    #3) 大いなる力には大いなる責任が伴うこと。

[sudo] shigeotsukuta のパスワード:
Oracle Linux 8 BaseOS Latest (x86_64)           0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'ol8_baseos_latest':
  - Curl error (6): Couldn't resolve host name for https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml [Could not resolve host: yum.oracle.com]
エラー: repo 'ol8_baseos_latest' のメタデータのダウンロードに失敗しました : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[shigeotsukuta@localhost ~]$ sudo yum update -y
Oracle Linux 8 BaseOS Latest (x86_64)           0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'ol8_baseos_latest':
  - Curl error (6): Couldn't resolve host name for https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml [Could not resolve host: yum.oracle.com]
エラー: repo 'ol8_baseos_latest' のメタデータのダウンロードに失敗しました : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[shigeotsukuta@localhost ~]$ 
[shigeotsukuta@localhost ~]$ 
[shigeotsukuta@localhost ~]$ docker
bash: docker: コマンドが見つかりませんでした...
ファイルの探索に失敗しました: cannot update repo 'ol8_baseos_latest': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Curl error (6): Couldn't resolve host name for https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml [Could not resolve host: yum.oracle.com]
[shigeotsukuta@localhost ~]$ 
[shigeotsukuta@localhost ~]$ 
[shigeotsukuta@localhost ~]$ ls -l /etc/yum.repos.d
合計 12
-rw-r--r--. 1 root root 2472 11月 10 10:29 oracle-linux-ol8.repo
-rw-r--r--. 1 root root  470 11月 10 15:25 uek-ol8.repo
-rw-r--r--. 1 root root  243 11月 10 15:25 virt-ol8.repo
[shigeotsukuta@localhost ~]$ sudo dnf upgrade -v
[sudo] shigeotsukuta のパスワード:
ロードされたプラグイン: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync, ulninfo
DNF version: 4.7.0
cachedir: /var/cache/dnf
User-Agent: constructed: 'libdnf (Oracle Linux Server 8.5; server; Linux.x86_64)'
repo: リモートからダウンロード中: ol8_baseos_latest
error: Curl error (6): Couldn't resolve host name for https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml [Could not resolve host: yum.oracle.com] (https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml).
error: Curl error (6): Couldn't resolve host name for https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml [Could not resolve host: yum.oracle.com] (https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml).
error: Curl error (6): Couldn't resolve host name for https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml [Could not resolve host: yum.oracle.com] (https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml).
error: Curl error (6): Couldn't resolve host name for https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml [Could not resolve host: yum.oracle.com] (https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml).
Oracle Linux 8 BaseOS Latest (x86_64)           0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'ol8_baseos_latest':
  - Curl error (6): Couldn't resolve host name for https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/repodata/repomd.xml [Could not resolve host: yum.oracle.com]
エラー: repo 'ol8_baseos_latest' のメタデータのダウンロードに失敗しました : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[shigeotsukuta@localhost ~]$ sudo yum update -y
Oracle Linux 8 BaseOS Latest (x86_64)           9.9 MB/s |  42 MB     00:04    
Oracle Linux 8 Application Stream (x86_64)       10 MB/s |  32 MB     00:03    
Latest Unbreakable Enterprise Kernel Release 6   10 MB/s |  35 MB     00:03    
メタデータの期限切れの最終確認: 0:00:09 時間前の 20220220201854秒 に実施しました。
依存関係が解決しました。
================================================================================
 パッケージ           Arch   バージョン                 リポジトリー      サイズ
================================================================================
インストール:
 kernel               x86_64 4.18.0-348.12.2.el8_5      ol8_baseos_latest 7.0 M
アップグレード:
 accountsservice      x86_64 0.6.55-2.el8_5.2           ol8_appstream     139 k
 accountsservice-libs x86_64 0.6.55-2.el8_5.2           ol8_appstream      96 k
 binutils             x86_64 2.30-108.0.2.el8_5.1       ol8_baseos_latest 5.9 M
 bpftool              x86_64 4.18.0-348.12.2.el8_5      ol8_baseos_latest 7.7 M
 btrfs-progs          x86_64 5.15.1-0.el8               ol8_UEKR6         866 k
 buildah              x86_64 1:1.23.1-2.0.1.module+el8.5.0+20494+0311868c
                                                        ol8_appstream     7.9 M
 clevis               x86_64 15-1.el8_5.1               ol8_appstream      57 k
 clevis-luks          x86_64 15-1.el8_5.1               ol8_appstream      37 k
 cockpit              x86_64 251.3-1.0.1.el8_5          ol8_baseos_latest  78 k
 cockpit-bridge       x86_64 251.3-1.0.1.el8_5          ol8_baseos_latest 540 k
 cockpit-podman       noarch 39-1.module+el8.5.0+20494+0311868c
                                                        ol8_appstream     483 k
 cockpit-system       noarch 251.3-1.0.1.el8_5          ol8_baseos_latest 3.2 M
(長いので中略)                            
  kernel-modules-4.18.0-348.12.2.el8_5.x86_64                                   
  kernel-uek-5.4.17-2136.304.4.1.el8uek.x86_64                                  

完了しました!
[shigeotsukuta@localhost ~]$ sudo su -
[sudo] shigeotsukuta のパスワード:
[root@localhost ~]# dnf repolist
repo id           repo の名前
ol8_UEKR6         Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_appstream     Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)
[root@localhost ~]# dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
repo の追加: https://download.docker.com/linux/centos/docker-ce.repo
[root@localhost ~]# dnf repolist
repo id           repo の名前
docker-ce-stable  Docker CE Stable - x86_64
ol8_UEKR6         Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_appstream     Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)
[root@localhost ~]# dnf info docker-ce docker-ce-cli containerd.io
Docker CE Stable - x86_64                       156 kB/s |  19 kB     00:00    
利用可能なパッケージ
名前         : containerd.io
バージョン   : 1.4.12
リリース     : 3.1.el8
Arch         : x86_64
サイズ       : 28 M
ソース       : containerd.io-1.4.12-3.1.el8.src.rpm
リポジトリー : docker-ce-stable
概要         : An industry-standard container runtime
URL          : https://containerd.io
ライセンス   : ASL 2.0
説明         : containerd is an industry-standard container runtime with an
             : emphasis on simplicity, robustness and portability. It is
             : available as a daemon for Linux and Windows, which can manage the
             : complete container lifecycle of its host system: image transfer
             : and storage, container execution and supervision, low-level
             : storage and network attachments, etc.

名前         : docker-ce
エポック     : 3
バージョン   : 20.10.12
リリース     : 3.el8
Arch         : x86_64
サイズ       : 22 M
ソース       : docker-ce-20.10.12-3.el8.src.rpm
リポジトリー : docker-ce-stable
概要         : The open-source application container engine
URL          : https://www.docker.com
ライセンス   : ASL 2.0
説明         : Docker is a product for you to build, ship and run any
             : application as a lightweight container.
             : 
             : Docker containers are both hardware-agnostic and
             : platform-agnostic. This means they can run anywhere, from your
             : laptop to the largest cloud compute instance and everything in
             : between - and they don't require you to use a particular
             : language, framework or packaging system. That makes them great
             : building blocks for deploying and scaling web apps, databases,
             : and backend services without depending on a particular stack or
             : provider.

名前         : docker-ce-cli
エポック     : 1
バージョン   : 20.10.12
リリース     : 3.el8
Arch         : x86_64
サイズ       : 30 M
ソース       : docker-ce-cli-20.10.12-3.el8.src.rpm
リポジトリー : docker-ce-stable
概要         : The open-source application container engine
URL          : https://www.docker.com
ライセンス   : ASL 2.0
説明         : Docker is is a product for you to build, ship and run any
             : application as a lightweight container.
             : 
             : Docker containers are both hardware-agnostic and
             : platform-agnostic. This means they can run anywhere, from your
             : laptop to the largest cloud compute instance and everything in
             : between - and they don't require you to use a particular
             : language, framework or packaging system. That makes them great
             : building blocks for deploying and scaling web apps, databases,
             : and backend services without depending on a particular stack or
             : provider.  
[root@localhost ~]# dnf install --allowerasing docker-ce docker-ce-cli containerd.io メタデータの期限切れの最終確認: 0:00:46 時間前の 20220221220615秒 に実施しました。 依存関係が解決しました。 ================================================================================ パッケージ Arch バージョン リポジトリー サイズ ================================================================================ インストール: containerd.io x86_64 1.4.12-3.1.el8 docker-ce-stable 28 M 置き換え runc.x86_64 1.0.3-1.module+el8.5.0+20494+0311868c docker-ce x86_64 3:20.10.12-3.el8 docker-ce-stable 22 M docker-ce-cli x86_64 1:20.10.12-3.el8 docker-ce-stable 30 M 依存関係のインストール: crun x86_64 1.4.1-1.module+el8.5.0+20494+0311868c ol8_appstream 205 k docker-ce-rootless-extras x86_64 20.10.12-3.el8 docker-ce-stable 4.6 M docker-scan-plugin x86_64 0.12.0-3.el8 docker-ce-stable 3.7 M libcgroup x86_64 0.41-19.el8 ol8_baseos_latest 70 k 依存関係パッケージの削除: buildah x86_64 1:1.23.1-2.0.1.module+el8.5.0+20494+0311868c @ol8_appstream 29 M cockpit-podman noarch 39-1.module+el8.5.0+20494+0311868c @ol8_appstream 484 k podman x86_64 1:3.4.2-9.0.1.module+el8.5.0+20494+0311868c @ol8_appstream 48 M podman-catatonit x86_64 1:3.4.2-9.0.1.module+el8.5.0+20494+0311868c @ol8_appstream 764 k ダウングレード: containers-common x86_64 1:1.2.2-10.0.1.module+el8.4.0+20195+0a4a4953 ol8_appstream 100 k トランザクションの概要 ================================================================================ インストール 7 パッケージ 削除 4 パッケージ ダウングレード 1 パッケージ ダウンロードサイズの合計: 89 M これでよろしいですか? [y/N]: y パッケージのダウンロード: (1/8): containers-common-1.2.2-10.0.1.module+el 68 kB/s | 100 kB 00:01 (2/8): containerd.io-1.4.12-3.1.el8.x86_64.rpm 4.7 MB/s | 28 MB 00:06 (3/8): docker-ce-20.10.12-3.el8.x86_64.rpm 3.5 MB/s | 22 MB 00:06 (4/8): docker-scan-plugin-0.12.0-3.el8.x86_64.r 3.7 MB/s | 3.7 MB 00:01 (5/8): libcgroup-0.41-19.el8.x86_64.rpm 1.4 MB/s | 70 kB 00:00 (6/8): docker-ce-rootless-extras-20.10.12-3.el8 3.3 MB/s | 4.6 MB 00:01 (7/8): crun-1.4.1-1.module+el8.5.0+20494+031186 3.9 MB/s | 205 kB 00:00 (8/8): docker-ce-cli-20.10.12-3.el8.x86_64.rpm 4.2 MB/s | 30 MB 00:07 -------------------------------------------------------------------------------- 合計 10 MB/s | 89 MB 00:08 Docker CE Stable - x86_64 34 kB/s | 1.6 kB 00:00 GPG 鍵 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 これでよろしいですか? [y/N]: y 鍵のインポートに成功しました トランザクションの確認を実行中 トランザクションの確認に成功しました。 トランザクションのテストを実行中 トランザクションのテストに成功しました。 トランザクションを実行中 準備 : 1/1 scriptletの実行中: docker-scan-plugin-0.12.0-3.el8.x86_64 1/1 インストール中 : docker-scan-plugin-0.12.0-3.el8.x86_64 1/14 scriptletの実行中: docker-scan-plugin-0.12.0-3.el8.x86_64 1/14 インストール中 : docker-ce-cli-1:20.10.12-3.el8.x86_64 2/14 scriptletの実行中: docker-ce-cli-1:20.10.12-3.el8.x86_64 2/14 インストール中 : crun-1.4.1-1.module+el8.5.0+20494+0311868c.x86_64 3/14 scriptletの実行中: libcgroup-0.41-19.el8.x86_64 4/14 インストール中 : libcgroup-0.41-19.el8.x86_64 4/14 scriptletの実行中: libcgroup-0.41-19.el8.x86_64 4/14 インストール中 : containerd.io-1.4.12-3.1.el8.x86_64 5/14 scriptletの実行中: containerd.io-1.4.12-3.1.el8.x86_64 5/14 インストール中 : docker-ce-rootless-extras-20.10.12-3.el8.x86_64 6/14 scriptletの実行中: docker-ce-rootless-extras-20.10.12-3.el8.x86_64 6/14 インストール中 : docker-ce-3:20.10.12-3.el8.x86_64 7/14 scriptletの実行中: docker-ce-3:20.10.12-3.el8.x86_64 7/14 ダウングレード中 : containers-common-1:1.2.2-10.0.1.module+el8.4.0+20 8/14 削除 : buildah-1:1.23.1-2.0.1.module+el8.5.0+20494+031186 9/14 削除 : cockpit-podman-39-1.module+el8.5.0+20494+0311868c. 10/14 削除 : podman-1:3.4.2-9.0.1.module+el8.5.0+20494+0311868c 11/14 scriptletの実行中: podman-1:3.4.2-9.0.1.module+el8.5.0+20494+0311868c 11/14 整理 : containers-common-2:1-8.0.1.module+el8.5.0+20494+0 12/14 削除 : podman-catatonit-1:3.4.2-9.0.1.module+el8.5.0+2049 13/14 廃止 : runc-1.0.3-1.module+el8.5.0+20494+0311868c.x86_64 14/14 scriptletの実行中: runc-1.0.3-1.module+el8.5.0+20494+0311868c.x86_64 14/14 検証 : containers-common-1:1.2.2-10.0.1.module+el8.4.0+20 1/14 検証 : containers-common-2:1-8.0.1.module+el8.5.0+20494+0 2/14 検証 : containerd.io-1.4.12-3.1.el8.x86_64 3/14 検証 : runc-1.0.3-1.module+el8.5.0+20494+0311868c.x86_64 4/14 検証 : docker-ce-3:20.10.12-3.el8.x86_64 5/14 検証 : docker-ce-cli-1:20.10.12-3.el8.x86_64 6/14 検証 : docker-ce-rootless-extras-20.10.12-3.el8.x86_64 7/14 検証 : docker-scan-plugin-0.12.0-3.el8.x86_64 8/14 検証 : libcgroup-0.41-19.el8.x86_64 9/14 検証 : crun-1.4.1-1.module+el8.5.0+20494+0311868c.x86_64 10/14 検証 : buildah-1:1.23.1-2.0.1.module+el8.5.0+20494+031186 11/14 検証 : cockpit-podman-39-1.module+el8.5.0+20494+0311868c. 12/14 検証 : podman-1:3.4.2-9.0.1.module+el8.5.0+20494+0311868c 13/14 検証 : podman-catatonit-1:3.4.2-9.0.1.module+el8.5.0+2049 14/14 ダウングレード済み: containers-common-1:1.2.2-10.0.1.module+el8.4.0+20195+0a4a4953.x86_64 インストール済み: containerd.io-1.4.12-3.1.el8.x86_64 crun-1.4.1-1.module+el8.5.0+20494+0311868c.x86_64 docker-ce-3:20.10.12-3.el8.x86_64 docker-ce-cli-1:20.10.12-3.el8.x86_64 docker-ce-rootless-extras-20.10.12-3.el8.x86_64 docker-scan-plugin-0.12.0-3.el8.x86_64 libcgroup-0.41-19.el8.x86_64 削除しました: buildah-1:1.23.1-2.0.1.module+el8.5.0+20494+0311868c.x86_64 cockpit-podman-39-1.module+el8.5.0+20494+0311868c.noarch podman-1:3.4.2-9.0.1.module+el8.5.0+20494+0311868c.x86_64 podman-catatonit-1:3.4.2-9.0.1.module+el8.5.0+20494+0311868c.x86_64 完了しました! [root@localhost ~]# dnf list installed | grep docker-ce containerd.io.x86_64 1.4.12-3.1.el8 @docker-ce-stable docker-ce.x86_64 3:20.10.12-3.el8 @docker-ce-stable docker-ce-cli.x86_64 1:20.10.12-3.el8 @docker-ce-stable docker-ce-rootless-extras.x86_64 20.10.12-3.el8 @docker-ce-stable docker-scan-plugin.x86_64 0.12.0-3.el8 @docker-ce-stable [root@localhost ~]# which docker /usr/bin/docker [root@localhost ~]# systemctl start docker [root@localhost ~]# systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor pre> Active: active (running) since Mon 2022-02-21 22:09:05 EST; 9s ago Docs: https://docs.docker.com Main PID: 84379 (dockerd) Tasks: 9 Memory: 31.8M CGroup: /system.slice/docker.service └─84379 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/conta> 221 22:09:03 localhost.localdomain dockerd[84379]: time="2022-02-21T22:09:0> 2月 21 22:09:03 localhost.localdomain dockerd[84379]: time="2022-02-21T22:09:0> 221 22:09:04 localhost.localdomain dockerd[84379]: time="2022-02-21T22:09:0> 2月 21 22:09:04 localhost.localdomain dockerd[84379]: time="2022-02-21T22:09:0> 221 22:09:05 localhost.localdomain dockerd[84379]: time="2022-02-21T22:09:0> 2月 21 22:09:05 localhost.localdomain dockerd[84379]: time="2022-02-21T22:09:0> 221 22:09:05 localhost.localdomain dockerd[84379]: time="2022-02-21T22:09:0> 2月 21 22:09:05 localhost.localdomain dockerd[84379]: time="2022-02-21T22:09:0> 221 22:09:05 localhost.localdomain systemd[1]: Started Docker Application C> 221 22:09:05 localhost.localdomain dockerd[84379]: time="2022-02-21T22:09:0> [root@localhost ~]# ps -aux | grep dockerd root 84379 0.8 2.4 1442944 82976 ? Ssl 22:09 0:00 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock root 84528 0.0 0.0 10304 1100 pts/0 S+ 22:09 0:00 grep --color=auto dockerd [root@localhost ~]# systemctl enable docker Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service. [root@localhost ~]# systemctl is-enabled docker enabled [root@localhost ~]# docker --version Docker version 20.10.12, build e91ed57 [root@localhost ~]# docker info Client: Context: default Debug Mode: false Plugins: app: Docker App (Docker Inc., v0.9.1-beta3) buildx: Docker Buildx (Docker Inc., v0.7.1-docker) scan: Docker Scan (Docker Inc., v0.12.0) Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 20.10.12 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: 7b11cfaabd73bb80907dd23182b9347b4245eb5d runc version: v1.0.2-0-g52b36a2 init version: de40ad0 Security Options: seccomp Profile: default Kernel Version: 5.4.17-2136.300.7.el8uek.x86_64 Operating System: Oracle Linux Server 8.5 OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 3.295GiB Name: localhost.localdomain ID: PZJL:T4DZ:5YH4:BG6T:W6QG:QION:QCCK:WGG7:BW36:GYQ7:K7O3:SSO6 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@localhost ~]# docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 2db29710123e: Pull complete Digest: sha256:97a379f4f88575512824f3b352bc03cd75e239179eea0fecc38e597b2209f49a Status: Downloaded newer image for 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@localhost ~]#

 

 

 

お時間あったら、他のエントリもクリックして頂ければ幸いです。