Docker安装

在Linux下安装docker

    yum -y install gcc
    yum -y install gcc-c++
     
    #卸载原来的docker
    yum remove docker \
                      docker-client \
                      docker-client-latest \
                      docker-common \
                      docker-latest \
                      docker-latest-logrotate \
                      docker-logrotate \
                      docker-engine
     
    #安装环境
    yum install -y yum-utils device-mapper-persistent-data lvm2
     
    #安装阿里云的镜像
    yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
     
    #更新软件索引包
    yum makecache fast
     
    #安装docker
    yum -y install docker-ce docker-ce-cli contaqinerd.io

然后报错了Error downloading packages:   3:docker-ce-23.0.4-1.el7.x86_64: [Errno 256] No more mirrors to try.

 尝试了很多的方法,依旧无法解决,无法正常安装docker

最后查看了阿里云开发者社区中的官方文档

https://developer.aliyun.com/mirror/docker-ce?spm=a2c6h.13651102.0.0.57401b117TlJ2Z

按照文档中,编辑etc/yum.repos.d/docker-ce.repo文件,将docker-ce-test下方的enabled=0修改为1

然后再次执行安装docker命令就安装成功了!

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

posted @ 2023-10-15 21:48  每天都想写博客  阅读(52)  评论(0)    收藏  举报