Centos安装Docker

Centos安装Docker

https://xxhh822.com:443/upload/Jiuqi-20220423-202752.png

1、确认版本是Centos7及以上

cat /etc/redhat-release

https://xxhh822.com:443/upload/Jiuqi-20220423-201541.png

2、安装gcc相关

yum -y install gcc
yum -y install gcc-c++

3、安装软件包

yum install -y yum-utils

4、设置镜像仓库

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

5、更新软件包索引

yum makecache fast

https://xxhh822.com:443/upload/Jiuqi-20220423-202108.png

6、安装Docker

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

https://xxhh822.com:443/upload/Jiuqi-20220423-202308.png

7、启动Docker

systemctl start docker

8、测试Docker

查看Docker版本

docker version

https://xxhh822.com:443/upload/Jiuqi-20220423-202329.png

运行hello-world

docker run hello-world

https://xxhh822.com:443/upload/Jiuqi-20220423-202408.png

9、配置阿里云加速

将代码复制执行即可。 https://xxhh822.com:443/upload/Jiuqi-20220423-202704.png

end

评论