centos8安装docker
docker官方安装文档
https://docs.docker.com/engine/install/centos/
0.周阳老师建议安装 gcc 和 gcc-c++
可以看我另一篇文章
centos8安装 gcc 和 gcc++ - 哔哩哔哩 (bilibili.com)
1.卸载旧版的操作

It’s OK if yum
reports that none of these packages are installed.
翻译:提示 没有东西可以卸载是ok的
Images, containers, volumes, and networks stored in /var/lib/docker/
aren’t automatically removed when you uninstall Docker.
翻译:卸载老版本时,镜像,容器,容器卷和网络不会被删除,目录是 /var/lib/docker/
2.设置仓库

图里面最后一行设置仓库地址时国外的,国内建议使用阿里云
3.更新yum软件包索引
如果是 centos7
如果是 centos8 不需要fast
至此安装docker的前提完成
4.真正开始安装docker

Install Docker Engine, containerd, and Docker Compose:
翻译:安装 Docker Engine, containerd, 和 Docker Compose
To install the latest version, run:
翻译:想安装最新版,直接跑下面的命令
这里遇到坑:
注意 centos8 如果出现报错
问题 1: problem with installed package podman-1.4.25.module_el8.1.0+237+63e26edc.x86_64
…
问题 2: problem with installed package cockpit-podman-4-1.module_el8.1.0+237+63e26edc.noarch
查看是否安装了Podman
控制台输出
podman-1.4.2-5.module_el8.1.0+237+63e26edc.x86_64
卸载podman
然后
yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
如果报下面的错误
problem with installed package buildah-1.9.0-5.module_el8.1.0+237+63e26edc.x86_64
在脚本后面加 --allowerasing
问你确定吗? 按y 然后回车 表示确定
5.启动

6.检查是否启动成功
Verify that Docker Engine installation is successful by running the hello-world
image.
翻译:跑一个 hello world 试试看docker管不管用

到这里 说明 docker已经安装成功,运行正常了
下一步操作:
阿里云镜像加速
https://www.aliyun.com/
搜索 容器镜像服务 ACR
进入控制台在镜像工具里面找到镜像加速器
在加速器下方可以看到文档
直接全复制,放到Linux里面粘贴,运行就完事了
