docker【一】Centos8 安装docker

#1、参考地址:
官方参考地址:https://docs.docker.com/engine/install/centos/
参考博客:https://blog.csdn.net/benleng/article/details/103080644
https://www.runoob.com/docker/centos-docker-install.html

#2、安装
yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

#3、配置修改
vi CentOS-Base.repo
baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/

vi CentOS-AppStream.repo
baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/

#4、清除缓存
dnf clean all

#5、安装
yum install -y https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/edge/Packages/containerd.io-1.2.13-3.2.el7.x86_64.rpm

yum install docker-ce docker-ce-cli

#6、测试
docker run hello-world

结果出现如下内容为安装成功:

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/

 

你可能感兴趣的:(docker)