LoginSignup
10
5

More than 3 years have passed since last update.

CentOS8でDockerCEをinstallする

Last updated at Posted at 2019-09-25

いつも通りインストールを試みたが

確認

[root@hogehoge test]# dnf repolist
repo id                                                                repo の名前                                                                      状態
AppStream                                                              CentOS-8 - AppStream                                                             4,928
BaseOS                                                                 CentOS-8 - Base                                                                  2,713
docker-ce-stable                                                       Docker CE Stable - x86_64                                                           51
extras                                                                 CentOS-8 - Extras                                                                    3
kubernetes                                                             Kubernetes                                                                           8

何か空白が広いけど とりあえずよさそう・・・
DockerCEをいつも通りinstall

[root@hogehoge test]# dnf install docker-ce
メタデータの期限切れの最終確認: 0:05:52 時間前の 2019年09月25日 16時40分21秒 に 実施しました。
エラー:
 問題: package docker-ce-3:19.03.2-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
  - cannot install the best candidate for the job
  - package containerd.io-1.2.2-3.3.el7.x86_64 is excluded
  - package containerd.io-1.2.2-3.el7.x86_64 is excluded
  - package containerd.io-1.2.4-3.1.el7.x86_64 is excluded
  - package containerd.io-1.2.5-3.1.el7.x86_64 is excluded
  - package containerd.io-1.2.6-3.3.el7.x86_64 is excluded
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

エラーが起きました。

原因

どうやらまだCentOS8をサポートするDockerCEの公式versionが出てないため・・・らしい。

対処

--nobest オプションを追加してinstall

依存関係など

[root@hogehoge test]# dnf install --nobest docker-ce
CentOS-8 - AppStream                            1.7 kB/s | 4.3 kB     00:02
CentOS-8 - Base                                 1.6 kB/s | 3.8 kB     00:02
CentOS-8 - Extras                               107  B/s | 1.5 kB     00:14
Docker CE Stable - x86_64                       3.4 kB/s | 3.5 kB     00:01
Kubernetes                                      177  B/s | 454  B     00:02
依存関係が解決しました。

 問題: package docker-ce-3:19.03.2-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
  - cannot install the best candidate for the job
  - package containerd.io-1.2.2-3.3.el7.x86_64 is excluded
  - package containerd.io-1.2.2-3.el7.x86_64 is excluded
  - package containerd.io-1.2.4-3.1.el7.x86_64 is excluded
  - package containerd.io-1.2.5-3.1.el7.x86_64 is excluded
  - package containerd.io-1.2.6-3.3.el7.x86_64 is excluded
================================================================================
 パッケージ     アーキテクチャー
                            バージョン              リポジトリ            サイズ
================================================================================
Installing:
 docker-ce      x86_64      18.06.3.ce-3.el7        docker-ce-stable       41 M
依存関係をインストール中:
 libcgroup      x86_64      0.41-19.el8             BaseOS                 70 k
壊れた dependencies のパッケージをスキップします:
 docker-ce      x86_64      3:19.03.2-3.el7         docker-ce-stable       24 M

トランザクションの概要
================================================================================
インストール  2 パッケージ
スキップ      1 パッケージ

ダウンロードサイズの合計: 41 M
インストール済みのサイズ: 168 M
これでよろしいですか? [y/N]: y

とりあえずよさそう・・・?

パッケージのダウンロード中です:
(1/2): libcgroup-0.41-19.el8.x86_64.rpm          54 kB/s |  70 kB     00:01
(2/2): docker-ce-18.06.3.ce-3.el7.x86_64.rpm     26 MB/s |  41 MB     00:01
--------------------------------------------------------------------------------
合計                                             14 MB/s |  41 MB     00:02
警告: /var/cache/dnf/docker-ce-stable-091d8a9c23201250/packages/docker-ce-18.06.3.ce-3.el7.x86_64.rpm: ヘッダー V4 RSA/SHA512 Signature、鍵 ID 621e9f35: NOKEY
Docker CE Stable - x86_64                       1.5 kB/s | 1.6 kB     00:01
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の実行中: libcgroup-0.41-19.el8.x86_64                           1/2
  Installing       : libcgroup-0.41-19.el8.x86_64                           1/2
  scriptletの実行中: libcgroup-0.41-19.el8.x86_64                           1/2
  scriptletの実行中: docker-ce-18.06.3.ce-3.el7.x86_64                      2/2
  Installing       : docker-ce-18.06.3.ce-3.el7.x86_64                      2/2
  scriptletの実行中: docker-ce-18.06.3.ce-3.el7.x86_64                      2/2
  検証             : libcgroup-0.41-19.el8.x86_64                           1/2
  検証             : docker-ce-18.06.3.ce-3.el7.x86_64                      2/2

インストール済み:
  docker-ce-18.06.3.ce-3.el7.x86_64         libcgroup-0.41-19.el8.x86_64

Skipped:
  docker-ce-3:19.03.2-3.el7.x86_64

完了しました!

なんか警告とか出てきてよくわかんないけど一応いけたみたい

[root@hogehoge test]# docker --version
Docker version 18.06.3-ce, build d7080c1

systemctl start と enable をしたdockerさん

● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2019-09-25 17:05:56 JST; 9s ago
     Docs: https://docs.docker.com
 Main PID: 5838 (dockerd)
    Tasks: 21 (limit: 26213)
   Memory: 48.6M
   CGroup: /system.slice/docker.service
           tq5838 /usr/bin/dockerd
           mq5845 docker-containerd --config /var/run/docker/containerd/containerd.toml

 9月 25 17:05:56 hogehoge dockerd[5838]: time="2019-09-25T17:05:56.581933392+09:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42021900>
 9月 25 17:05:56 hogehoge dockerd[5838]: time="2019-09-25T17:05:56.582069766+09:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42021900>
 9月 25 17:05:56 hogehoge dockerd[5838]: time="2019-09-25T17:05:56.582086337+09:00" level=info msg="Loading containers: start."
 9月 25 17:05:56 hogehoge dockerd[5838]: time="2019-09-25T17:05:56.712977622+09:00" level=info msg="Default bridge (docker0) is assigned with an IP address >
 9月 25 17:05:56 hogehoge dockerd[5838]: time="2019-09-25T17:05:56.812511479+09:00" level=info msg="Loading containers: done."
 9月 25 17:05:56 hogehoge dockerd[5838]: time="2019-09-25T17:05:56.834170403+09:00" level=info msg="Docker daemon" commit=d7080c1 graphdriver(s)=overlay2 ve>
 9月 25 17:05:56 hogehoge dockerd[5838]: time="2019-09-25T17:05:56.834254871+09:00" level=info msg="Daemon has completed initialization"
 9月 25 17:05:56 hogehoge dockerd[5838]: time="2019-09-25T17:05:56.838428435+09:00" level=warning msg="Could not register builder git source: failed to find>
 9月 25 17:05:56 hogehoge systemd[1]: Started Docker Application Container Engine.
 9月 25 17:05:56 hogehoge dockerd[5838]: time="2019-09-25T17:05:56.853931602+09:00" level=info msg="API listen on /var/run/docker.sock"

一応解決はしたけど根本的な解決は出来ていない気がする・・・
それともまだ仕方ないのかな??
キレイにインストール出来た方とかいたら教えて頂けると嬉しいです。

参考

How to install Docker CE on RHEL 8 / CentOS 8

2019/12/23追記

Kubernetes Advent Calendar 2019の12/5の @kaitoy さんの記事Kubernetes 1.16 のクラスタを CentOS 8 と containerd で構築する で、上記の問題が一旦納得できたので、その一部分を要約させていただきます。

  • RHEL8ではDockerがRed Hatのyumレポジトリからの配布が廃止された。
  • Red Hatは恐らく代わりに自製のPodmanを推奨している。
  • PodmanはCRIも実装しておらず、Kubernetes向きではない。
  • DockerCEはRHELをサポートしていない

ということでDockerの代わりにcontainerdを使い構築したとの話です。
KubernetesでDockerを動かすならやはりCentOS8よりも7がよさそうですね・・・

10
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
5