当前位置: 首页 > 图灵资讯 > 技术篇> CentOS安装 Docker(在线)

CentOS安装 Docker(在线)

来源:图灵教育
时间:2023-04-24 10:24:35

  (1)查看现有的Docker环境yum list installed | grep docker

  (2)卸载现有的Docker环境 yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine

  (3)设置本地源 yum install -y yum-utilsyum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo

  (4)安装Docker yum install docker-ce -y

  (5)镜像加速配置 mkdir -p /etc/dockertee /etc/docker/daemon.json <<-'EOF'{ "registry-mirrors": ["https://e3r7iyl5.mirror.aliyuncs.com"]}EOFsudo systemctl daemon-reload

  (6)启动Docker systemctl restart docker