CentOS 8.0はdockerエラーをインストールします:問題:パッケージdocker-ce-3:19.03.8-3.el7.x86_64にはcontainerd.io> = 1.2.2-3が必要です
インストール手順については、公式ドキュメントを参照してください。
https://docs.docker.com/install/linux/docker-ce/centos/
古いバージョンをアンインストールします
[ root@localhost ~]# remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
DockerEngineのコミュニティバージョンをインストールする
[ root@localhost ~]# yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
[ root@localhost ~]# sudo yum-config-manager \
- - add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
[ root@localhost ~]# yum-config-manager --enable docker-ce-nightlyyum-config-manager --enable docker-ce-test
[ root@localhost ~]# yum-config-manager --enable docker-ce-test
[ root@localhost ~]# yum-config-manager --disable docker-ce-nightly
[ root@localhost ~]# yum install docker-ce docker-ce-cli containerd.io
# このステップエラーをインストールします
エラー内容
[ root@localhost yum.repos.d]# yum install docker-ce docker-ce-cli containerd.io
Last metadata expiration check:0:04:46 ago on Mon 16 Mar 202003:40:11 PM CST.
Package containerd.io-1.2.0-3.el7.x86_64 is already installed.
Error:
Problem:package docker-ce-3:19.03.8-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.10-3.2.el7.x86_64 is excluded
- package containerd.io-1.2.13-3.1.el7.x86_64 is excluded
- 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
- package containerd.io-1.2.11-3.2.el7.x86_64 is excluded
- package containerd.io-1.2.12-3.1.el7.x86_64 is excluded
- package containerd.io-1.2.6-3.2.el7.x86_64 is excluded(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
理由を分析する
上記の内容を見ると、containerd.io> = 1.2.2-3と言われています。つまり、containerd.ioのバージョンは1.2.2-3以上である必要があります。
解決する
1、 dockerのバージョンを下げる
2、 dockerのバージョンを下げたくない場合は、containerd.ioのバージョンを更新してください
[ root@localhost ~]# yum install -y wget
[ root@localhost ~]# wget https://download.docker.com/linux/centos/7/x86_64/edge/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
[ root@localhost ~]# yum install -y containerd.io-1.2.6-3.3.el7.x86_64.rpm
[ root@localhost ~]# yum install docker-ce docker-ce-cli
dockerを起動します
[ root@localhost ~]# systemctl start docker
インストールが成功したかどうかを確認します
1、 バージョン番号を確認してください
[ root@localhost ~]# docker -v
Docker version 19.03.8, build afacb8b
2、 hello-worldコンテナを実行します
[ root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1 b930d010525: Pull complete
Digest: sha256:f9dfddf63636d84ef479d645ab5885156ae030f611a56f3a7ac7f2fdd86d7e4e
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 newcontainerfrom 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/
3、 tomcatコンテナを実行し、ポート番号をマッピングします
[ root@localhost etc]# docker pull tomcat
Using default tag: latest
latest: Pulling from library/tomcat
50 e431f79093: Pull complete
dd8c6d374ea5: Pull complete
c85513200d84: Pull complete
55769680 e827: Pull complete
e27ce2095ec2: Pull complete
5943 eea6cb7c: Pull complete
3 ed8ceae72a6: Pull complete
91 d1e510d72b: Pull complete
98 ce65c663bc: Pull complete
27 d4ac9d012a: Pull complete
Digest: sha256:2c90303e910d7d5323935b6dc4f8ba59cc1ec99cf1b71fd6ca5158835cffdc9c
Status: Downloaded newer image for tomcat:latest
docker.io/library/tomcat:latest
[ root@localhost etc]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
tomcat latest 4e7840b49fad 2 weeks ago 529MB
hello-world latest fce289e99eb9 14 months ago 1.84kB
[ root@localhost etc]# docker run -it -p 8888:8080 tomcat
Using CATALINA_BASE:/usr/local/tomcat
Using CATALINA_HOME:/usr/local/tomcat
Using CATALINA_TMPDIR:/usr/local/tomcat/temp
Using JRE_HOME:/usr/local/openjdk-8
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
16- Mar-202009:22:23.444 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/8.5.5116-Mar-202009:22:23.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 5202022:26:25 UTC
16- Mar-202009:22:23.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number:8.5.51.016-Mar-202009:22:23.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
16- Mar-202009:22:23.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:4.18.0-80.el8.x86_64
16- Mar-202009:22:23.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
16- Mar-202009:22:23.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:/usr/local/openjdk-8/jre
16- Mar-202009:22:23.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:1.8.0_242-b08
16- Mar-202009:22:23.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
16- Mar-202009:22:23.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:/usr/local/tomcat
16- Mar-202009:22:23.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:/usr/local/tomcat
16- Mar-202009:22:23.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:-Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
16- Mar-202009:22:23.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
16- Mar-202009:22:23.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:-Djdk.tls.ephemeralDHKeySize=204816-Mar-202009:22:23.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:-Djava.protocol.handler.pkgs=org.apache.catalina.webresources
16- Mar-202009:22:23.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:-Dorg.apache.catalina.security.SecurityListener.UMASK=002716-Mar-202009:22:23.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:-Dignore.endorsed.dirs=16-Mar-202009:22:23.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:-Dcatalina.base=/usr/local/tomcat
16- Mar-202009:22:23.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:-Dcatalina.home=/usr/local/tomcat
16- Mar-202009:22:23.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:-Djava.io.tmpdir=/usr/local/tomcat/temp
16- Mar-202009:22:23.446 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.23] using APR version [1.6.5].16-Mar-202009:22:23.446 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].16-Mar-202009:22:23.446 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]16-Mar-202009:22:23.454 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1d 10 Sep 2019]16-Mar-202009:22:23.520 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]16-Mar-202009:22:23.533 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
16- Mar-202009:22:23.552 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in367 ms
16- Mar-202009:22:23.584 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]16-Mar-202009:22:23.584 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.5116-Mar-202009:22:23.595 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]16-Mar-202009:22:23.611 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in58 ms
THE
END
Recommended Posts