Docker安装详细步骤

本文档详细介绍了如何在CentOS 8系统上卸载旧版Docker,配置阿里云镜像仓库,安装Docker CE社区版,启动Docker服务,并运行'hello-world'验证安装。最后,展示了如何卸载Docker及其相关资源。
摘要由CSDN通过智能技术生成

docker官网详细步骤:https://docs.docker.com/engine/install/centos/

1、环境查看

#系统内核

#[root ~]# uname -r
4.18.0-147.8.1.el8_1.x86_64

#系统版本

#[root ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"

2、卸载旧的版本

 yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

 

 3、需要的安装包

yum install -y yum-utils

4、 设置镜像的仓库(阿里云)

yum-config-manager \
    --add-repo \
    http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

5、 安装docker     ce社区  ee企业版

yum install docker-ce docker-ce-cli containerd.io

 6、启动docker

systemctl start docker

7、 hello-world

docker run hello-world

8、查看一下下载的hell-world镜像

# docker images

REPOSITORY    TAG       IMAGE ID       CREATED       SIZE
hello-world   latest    d1165f221234   2 weeks ago   13.3kB

 9、了解:卸载docker

#卸载依赖

yum remove docker-ce docker-ce-cli containerd.io

#删除资源(/var/lib/docker  docker的默认工作路径)

 sudo rm -rf /var/lib/docker

 

docker run执行后干了些什么? 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值