RockyLinux安装docker并配置可用镜像源 835次阅读 Centos • 学习归纳 2024-06-27 ## 一、安装docker-ce ##### 1、删除已经安装的docker ```shell sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine ```  ##### 2、安装系统工具 ```shell [root@localhost ~]# sudo yum install -y yum-utils device-mapper-persistent-data lvm2 ```  ##### 3、添加阿里云的docker yum repo源 ```shell [root@localhost ~]# sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo ```  ##### 4、安装docker-ce(Community Edition) ```shell [root@localhost ~]# yum install docker-ce -y ```  ##### 5、设置开机启动并启动docker ```shell [root@localhost ~]# systemctl enable docker && systemctl start docker ```  ##### 6、查看docker状态 ```shell [root@localhost ~]# systemctl status docker ```  至此docker安装完成。 ------ ## 二、配置可用镜像源 ##### 1、尝试从默认服务器上pull nginx镜像,可以发现pull不下来  ##### 2、修改deamon.json文件 ```shell [root@localhost ~]# vim /etc/docker/daemon.json ``` ##### 3、按照如下格式填入可用的镜像源(自行百度) ```json { "registry-mirrors": [ "https://docker.m.daocloud.io", "https://dockerhub.timeweb.cloud", "https://huecker.io", "https://noohub.ru" ] } ```  ##### 4、重启docker deamon和docker服务 ```shell [root@localhost ~]# systemctl daemon-reload && systemctl restart docker ``` ##### 5、查看docker信息 ```shell [root@localhost docker]# docker info ```  ##### 6、再次尝试pull nginx镜像  可以看到已经可以pull下来了,配置完成! 另外,按照国内的大环境,正规的镜像服务器会越来越少......有能力建议上v2raya 最后一次更新于2024-06-27 None
0 条评论