博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
解决Centos7安装docker源问题
阅读量:6952 次
发布时间:2019-06-27

本文共 2593 字,大约阅读时间需要 8 分钟。

根据官方文档: 

1.卸载docker旧版本:

sudo yum remove docker \

                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine\

2.安装相关工具类:

sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2

3.配置docker仓库:

sudo yum-config-manager \ --add-repo \

会报以下错误: Loaded plugins: fastestmirror adding repo from: grabbing file to /etc/yum.repos.d/docker-ce.repo Could not fetch/save url to file /etc/yum.repos.d/docker-ce.repo : [Errno 14] curl#35 - "TCP connection reset by peer

这是由于国内访问不到docker官方镜像的缘故 

可以通过aliyun的源来完成:

sudo yum-config-manager --add-repo

出现以下内容则表示docker仓库配置成功:

Loaded plugins: fastestmirror adding repo from: grabbing file to /etc/yum.repos.d/docker-ce.repo repo saved to /etc/yum.repos.d/docker-ce.repo

4.安装docker

sudo yum install docker-ce

出现以下异常:

Loaded plugins: fastestmirror
base
: [Errno 14] curl#35 - "TCP connection reset by peer"
Trying other mirror.
 One of the configured repositories failed (Docker CE Stable - x86_64),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working

        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled

            yum --disablerepo=docker-ce-stable ...

     4. Disable the repository permanently, so yum won't use it by default. Yum

        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable docker-ce-stable

        or
            subscription-manager repos --disable=docker-ce-stable

     5. Configure the failing repository to be skipped, if it is unavailable.

        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=docker-ce-stable.skip_if_unavailable=true

failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.

: [Errno 14] curl#35 - "TCP connection reset by peer"

[root@localhost yum.repos.d]# systemctl restart docker 

[root@localhost yum.repos.d]# systemctl status docker

转载于:https://blog.51cto.com/12333622/2348842

你可能感兴趣的文章
Hbase 集群搭建
查看>>
分布式文件服务器dfs
查看>>
正则表达式
查看>>
关于直播视频格式和浏览器兼容性历史的来龙去脉
查看>>
是的,InfoQ正在招聘技术编辑!跟对的人,一起做喜欢的事!
查看>>
vue2+vue-cli,dis文件加载出错解决方案
查看>>
立下“去O”Flag的AWS,悄悄修炼了哪些内功?
查看>>
关于团队建设,穆帅能教我们什么?
查看>>
2019 SRE 调查报告:事故处理是主要工作,SRE 压力山大
查看>>
xpath学习
查看>>
Java工程师的成长路线图是什么?
查看>>
JavaOne 2016——首日亮点
查看>>
EDU_BOOK 开发总结
查看>>
简单的支持网页画框拖拽缩放功能的js插件
查看>>
使用 ES2015 开发 Angular1.x 应用指南
查看>>
密码学协议 门限
查看>>
true or false in JavaScript
查看>>
Android学习笔记6:使用Intent1
查看>>
js实现继承的几种方式
查看>>
[LintCode/LeetCode] Two Strings are Anagrams/Valid Anagram
查看>>