Centos8安装Docker


yum install -y yum-utils  device-mapper-persistent-data  lvm2

yum-config-manager  --add-repo   https://download.docker.com/linux/centos/docker-ce.repo

[root@NMS yum.repos.d]# sudo yum install docker-ce docker-ce-cli
Last metadata expiration check: 0:03:53 ago on Fri 02 Jul 2021 08:18:32 PM CST.
Error:
Problem: problem with installed package buildah-1.19.7-1.module_el8.4.0+781+acf4c33b.x86_64
- 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 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

运行下方代码即可解决:

yum erase podman buildah

查看Docker版本

 

[root@NMS src]# docker -v
Dodocker version 20.10.7, build f0df350
[rroot@NMS src]# ps -aux | grep docker roroot 32830 0.0 0.0 179368 872 ? Ss 20:25 0:00 gpg-agent --homedir /var/cache/PackageKit/8/metadata/docker-ce-stable-8-x86_64.tmp/gpgdir --use-standard-socket --daemon roroot 35962 1.2 2.5 932280 95096 ? Ssl 20:43 0:00 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock roroot 36091 0.0 0.0 12136 1068 pts/0 S+ 20:43 0:00 grep --color=auto docker
[root@NMS src]# docker run hello-world
r 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 xiajun]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 15 months ago 1.84kB

  

  

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM