Linux安装docker详细教程

时间:2024-10-13 11:51:18

1、安装yum-utils 工具包sudo yum install -y yum-utils

Linux安装docker详细教程

2、设置下载库sudo yum-config-manager \ --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Linux安装docker详细教程

3、移除podman (与docker冲突)yum erase podman buildah

Linux安装docker详细教程

4、安装dockersudo yum install docker-ce docker-ce-cli containerd.io

Linux安装docker详细教程

5、启动docker服务systemctl start docker

6、开机启动docker服务systemctl enable docker

Linux安装docker详细教程

7、修改阿里云镜像(国内下载速度慢)sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://pembhne7.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker

8、运行测试程序sudo docker run hello-world

Linux安装docker详细教程
© 手抄报圈