2021年7月16日 星期五

[研究]docker 20.10.7 安裝 (CentOS 8.4)

[研究]docker 20.10.7 安裝 (CentOS 8.4)

2021-07-16

參考

Install Docker Engine on CentOS | Docker Documentation
https://docs.docker.com/engine/install/centos/

精簡彙整安裝過程


sudo yum -y remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine sudo yum install -y yum-utils sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo yum erase -y podman buildah sudo yum install -y docker-ce docker-ce-cli containerd.io sudo systemctl enable docker sudo systemctl start docker docker --version


********************************************************************************

詳細過程如下

移除舊版


[john@localhost ~]$ sudo yum -y remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine 
[sudo] password for john: 
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!
[john@localhost ~]$ 

為了有 yum-config-manager ,安裝 yum-utils


[john@localhost ~]$ sudo yum install -y yum-utils

用 yum-config-manager 設定  Repository

  
[john@localhost ~]$  sudo yum-config-manager  --add-repo  https://download.docker.com/linux/centos/docker-ce.repo
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
[john@localhost ~]$ 

安裝 Docker Engine ( 引擎)


[john@localhost ~]$ sudo yum install -y docker-ce docker-ce-cli containerd.io Docker CE Stable - x86_64 125 kB/s | 14 kB 00:00 Last metadata expiration check: 0:00:01 ago on Fri 16 Jul 2021 09:21:53 AM EDT. Error: Problem 1: problem with installed package podman-3.0.1-7.module_el8.4.0+830+8027e1c4.x86_64 - package podman-3.0.1-7.module_el8.4.0+830+8027e1c4.x86_64 requires runc >= 1.0.0-57, but none of the providers can be installed - package podman-3.0.1-6.module_el8.4.0+781+acf4c33b.x86_64 requires runc >= 1.0.0-57, but none of the providers can be installed - package containerd.io-1.4.6-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64 - package containerd.io-1.4.6-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64 - package containerd.io-1.4.6-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64 - package containerd.io-1.4.6-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64 - cannot install the best candidate for the job - package runc-1.0.0-64.rc10.module_el8.4.0+522+66908d0c.x86_64 is filtered out by modular filtering - package runc-1.0.0-65.rc10.module_el8.4.0+819+4afbd1d6.x86_64 is filtered out by modular filtering - package runc-1.0.0-70.rc92.module_el8.4.0+786+4668b267.x86_64 is filtered out by modular filtering - package runc-1.0.0-71.rc92.module_el8.4.0+833+9763146c.x86_64 is filtered out by modular filtering Problem 2: package podman-3.0.1-6.module_el8.4.0+781+acf4c33b.x86_64 requires runc >= 1.0.0-57, but none of the providers can be installed - package containerd.io-1.4.3-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64 - package containerd.io-1.4.3-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64 - package containerd.io-1.4.3-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64 - package containerd.io-1.4.3-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64 - package docker-ce-3:20.10.7-3.el8.x86_64 requires containerd.io >= 1.4.1, but none of the providers can be installed - package containerd.io-1.4.3-3.2.el8.x86_64 conflicts with runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64 - package containerd.io-1.4.3-3.2.el8.x86_64 obsoletes runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64 - package containerd.io-1.4.3-3.2.el8.x86_64 conflicts with runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64 - package containerd.io-1.4.3-3.2.el8.x86_64 obsoletes runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64 - package podman-catatonit-3.0.1-6.module_el8.4.0+781+acf4c33b.x86_64 requires podman = 3.0.1-6.module_el8.4.0+781+acf4c33b, but none of the providers can be installed - problem with installed package podman-catatonit-3.0.1-7.module_el8.4.0+830+8027e1c4.x86_64 - package podman-catatonit-3.0.1-7.module_el8.4.0+830+8027e1c4.x86_64 requires podman = 3.0.1-7.module_el8.4.0+830+8027e1c4, but none of the providers can be installed - package podman-3.0.1-7.module_el8.4.0+830+8027e1c4.x86_64 requires runc >= 1.0.0-57, but none of the providers can be installed - package containerd.io-1.4.4-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64 - package containerd.io-1.4.4-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64 - package containerd.io-1.4.6-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64 - package containerd.io-1.4.6-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64 - cannot install the best candidate for the job - package runc-1.0.0-64.rc10.module_el8.4.0+522+66908d0c.x86_64 is filtered out by modular filtering - package runc-1.0.0-65.rc10.module_el8.4.0+819+4afbd1d6.x86_64 is filtered out by modular filtering - package runc-1.0.0-70.rc92.module_el8.4.0+786+4668b267.x86_64 is filtered out by modular filtering - package runc-1.0.0-71.rc92.module_el8.4.0+833+9763146c.x86_64 is filtered out by modular filtering - package containerd.io-1.4.4-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64 - package containerd.io-1.4.4-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64 - package containerd.io-1.4.6-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64 - package containerd.io-1.4.6-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64 (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages) [john@localhost ~]$  


目前提供的


[john@localhost ~]$ dnf list docker-ce --showduplicates | sort -r docker-ce.x86_64 3:20.10.7-3.el8 docker-ce-stable docker-ce.x86_64 3:20.10.6-3.el8 docker-ce-stable docker-ce.x86_64 3:20.10.5-3.el8 docker-ce-stable docker-ce.x86_64 3:20.10.4-3.el8 docker-ce-stable docker-ce.x86_64 3:20.10.3-3.el8 docker-ce-stable docker-ce.x86_64 3:20.10.2-3.el8 docker-ce-stable docker-ce.x86_64 3:20.10.1-3.el8 docker-ce-stable docker-ce.x86_64 3:20.10.0-3.el8 docker-ce-stable docker-ce.x86_64 3:19.03.15-3.el8 docker-ce-stable docker-ce.x86_64 3:19.03.14-3.el8 docker-ce-stable docker-ce.x86_64 3:19.03.13-3.el8 docker-ce-stable Docker CE Stable - x86_64 78 kB/s | 14 kB 00:00 CentOS Linux 8 - Extras 15 kB/s | 9.8 kB 00:00 CentOS Linux 8 - BaseOS 1.5 MB/s | 3.6 MB 00:02 CentOS Linux 8 - AppStream 3.9 MB/s | 8.1 MB 00:02 Available Packages [john@localhost ~]$  

移除有問題的 podman


[john@localhost ~]$ sudo yum erase -y podman  

再來一次,這次說 buildah 有問題

[john@localhost ~]$ sudo yum install -y docker-ce docker-ce-cli containerd.io
Last metadata expiration check: 0:12:42 ago on Fri 16 Jul 2021 09:21:53 AM EDT.
Error: 
 Problem: problem with installed package buildah-1.19.7-2.module_el8.4.0+830+8027e1c4.x86_64
  - package buildah-1.19.7-2.module_el8.4.0+830+8027e1c4.x86_64 requires runc >= 1.0.0-26, but none of the providers can be installed
  - package buildah-1.19.7-1.module_el8.4.0+781+acf4c33b.x86_64 requires runc >= 1.0.0-26, but none of the providers can be installed
  - package containerd.io-1.4.6-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64
  - package containerd.io-1.4.6-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-73.rc93.module_el8.4.0+830+8027e1c4.x86_64
  - package containerd.io-1.4.6-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64
  - package containerd.io-1.4.6-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-70.rc92.module_el8.4.0+673+eabfc99d.x86_64
  - cannot install the best candidate for the job
  - package runc-1.0.0-56.rc5.dev.git2abd837.module_el8.3.0+569+1bada2e4.x86_64 is filtered out by modular filtering
  - package runc-1.0.0-64.rc10.module_el8.4.0+522+66908d0c.x86_64 is filtered out by modular filtering
  - package runc-1.0.0-65.rc10.module_el8.4.0+819+4afbd1d6.x86_64 is filtered out by modular filtering
  - package runc-1.0.0-70.rc92.module_el8.4.0+786+4668b267.x86_64 is filtered out by modular filtering
  - package runc-1.0.0-71.rc92.module_el8.4.0+833+9763146c.x86_64 is filtered out by modular filtering
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[john@localhost ~]$ 


移除有問題的 buildah


[john@localhost ~]$ sudo yum erase -y buildah  

再來一次,成功了


[john@localhost ~]$ sudo yum install -y docker-ce docker-ce-cli containerd.io  

檢查版本


[john@localhost ~]$ docker --version Docker version 20.10.7, build f0df350 [john@localhost ~]$  

設定開機自動啟動 docker


[john@localhost ~]$ sudo systemctl enable docker Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service. [john@localhost ~]$ 

立刻啟動 docker


[john@localhost ~]$ sudo systemctl start docker   

立刻停止 docker  (好像不行)


[john@localhost ~]$ sudo systemctl stop docker Warning: Stopping docker.service, but it can still be activated by: docker.socket [john@localhost ~]$  


檢查 docker 狀態


[john@localhost ~]$ sudo systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor pres> Active: inactive (dead) since Fri 2021-07-16 09:45:52 EDT; 39s ago Docs: https://docs.docker.com Process: 12082 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containe> Main PID: 12082 (code=exited, status=0/SUCCESS) Jul 16 09:45:12 localhost.localdomain dockerd[12082]: time="2021-07-16T09:45:12> Jul 16 09:45:12 localhost.localdomain dockerd[12082]: time="2021-07-16T09:45:12> Jul 16 09:45:12 localhost.localdomain dockerd[12082]: time="2021-07-16T09:45:12> Jul 16 09:45:12 localhost.localdomain systemd[1]: Started Docker Application Co> Jul 16 09:45:52 localhost.localdomain systemd[1]: Stopping Docker Application C> Jul 16 09:45:52 localhost.localdomain dockerd[12082]: time="2021-07-16T09:45:52> Jul 16 09:45:52 localhost.localdomain dockerd[12082]: time="2021-07-16T09:45:52> Jul 16 09:45:52 localhost.localdomain dockerd[12082]: time="2021-07-16T09:45:52> Jul 16 09:45:52 localhost.localdomain systemd[1]: docker.service: Succeeded. Jul 16 09:45:52 localhost.localdomain systemd[1]: Stopped Docker Application Co> [john@localhost ~]$  

(完)

相關

什麼是 Docker? | Microsoft Docs
https://docs.microsoft.com/zh-tw/dotnet/architecture/containerized-lifecycle/what-is-docker

Install Docker Engine on CentOS | Docker Documentation
https://docs.docker.com/engine/install/centos/


沒有留言:

張貼留言