centos8安裝docker
docker官方安裝文檔
https://docs.docker.com/engine/install/centos/
0.周陽老師建議安裝 gcc 和 gcc-c++
【尚硅谷Docker實(shí)戰(zhàn)教程(docker教程天花板)】
可以看我另一篇文章
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.
翻譯:卸載老版本時,鏡像,容器,容器卷和網(wǎng)絡(luò)不會被刪除,目錄是?/var/lib/docker/?
2.設(shè)置倉庫

圖里面最后一行設(shè)置倉庫地址時國外的,國內(nèi)建議使用阿里云
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 如果出現(xiàn)報(bào)錯
問題 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
如果報(bào)下面的錯誤
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已經(jīng)安裝成功,運(yùn)行正常了
下一步操作:
阿里云鏡像加速
https://www.aliyun.com/
搜索 容器鏡像服務(wù) ACR
進(jìn)入控制臺在鏡像工具里面找到鏡像加速器
在加速器下方可以看到文檔
直接全復(fù)制,放到Linux里面粘貼,運(yùn)行就完事了
