docker的安装及阿里镜像加速

tech2022-07-29  182

1、删除老的版本

sudo yum remove docker\ docker-client\ docker-client-latest\ docker-common\

2、安装依赖包

sudo yum install -y yum-utils \ device-mapper-persistent-data \ 1vm2

3、安装docker

sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo sudo yum install docker-ce docker-ce-cli containerd.io

4、启动docker

sudo systemctl start docker

查看

docker -v

5、开机自启动

sudo systemctl enable docker

6、docker镜像加速,找到阿里云的镜像加速器,你自己的

sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://*****.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
最新回复(0)