解决Centos7安装docker源问题

根据官方文档:https://docs.docker.com/install/linux/docker-ce/centos/搭建docker?

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 \ https://download.docker.com/linux/centos/docker-ce.repo

会报以下错误: Loaded plugins: fastestmirror adding repo from: https://download.docker.com/linux/centos/docker-ce.repo grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo Could not fetch/save url https://download.docker.com/linux/centos/docker-ce.repo 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 http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

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

Loaded plugins: fastestmirror adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo grabbing file http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo 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
https://download-stage.docker.com/linux/centos/7/x86_64/stable/repodata/repomd.xml: [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.
https://download-stage.docker.com/linux/centos/7/x86_64/stable/repodata/repomd.xml: [Errno 14] curl#35 - "TCP connection reset by peer"

[[email protected] yum.repos.d]# systemctl restart docker?
[[email protected] yum.repos.d]# systemctl status docker

原文地址:http://blog.51cto.com/12333622/2348842

时间: 2024-07-31 02:12:03

解决Centos7安装docker源问题的相关文章

centos7安装docker并配置php运行环境

原文:centos7安装docker并配置php运行环境 一.安装docker 首先我们先来了解一下什么是docker. docker是一个虚拟化的技术,基于 Linux 内核,是将进程进行封装隔离,由于隔离的进程独立于宿主机和其它的隔离的进程,因此也可以称为容器.很多人把docker理解为虚拟机,其实不是的,因为它不需要进行硬件虚拟以及运行完整操作系统等额外开销的,docker的出现也是为了解决在各种复杂的环境下不需要做任何的修改还可以保证程序正常稳定的运行,也就是环境一致性的问题,当然还有k

Centos7安装Docker CE

原文:Centos7安装Docker CE 每次安装Docker都要去找文档,或者每次安装的都不一样,还是要好好管理自己的这些东西,下次用的时候可以省很多的时间 Docker的早期版本称为docker或docker-engine:现在的Docker CE软件包称为docker-ce ; 环境 Centos7 安装脚本 #!/bin/bash #filename: install_docker.sh #Version: v1.0.0 #Author: LiLe #Date: 20190306 #C

CentOS7安装docker以及错误解决

今天在公司电脑上安装docker出现了一些问题,原先是直接用yum安装docker,一次就成功了,由于公司的网络问题导致docker安装完出现了一些问题,客户端启动了,服务端一直启动不了:Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe"

centos7安装docker

1.查看linux发行版,内核 [[email protected]~]# cat /etc/redhat-release #查看版本号 CentOS Linux release 7.1.1503 (Core) [[email protected] ~]# uname -r #查看Linux内核 c3.10.0-229.el7.x86_64 2.替换阿里云yum源 1 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.

Centos7安装docker应用容器引擎

Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从Apache2.0协议开源. Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化. 容器是完全使用沙箱机制,相互之间不会有任何接口(类似 iPhone 的 app),更重要的是容器性能开销极低. Docker的应用场景 Web 应用的自动化打包和发布. 自动化测试和持续集成.发布. 在服务型环境中部署和调整数据库或其他的后台应用. 从头编译或者扩

Docker系列之CentOS7安装Docker(一)

0.前言 整体架构目录:ASP.NET Core分布式项目实战-目录 一.瞎扯淡(只讲有用的) 感兴趣的同学可以上网搜索一下docker具体的介绍.我这边主要介绍偏实战的内容,不喜勿喷,有问题也请指出. 官方给出的介绍:docker就是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任务流行的linux机器上,实现虚拟化. 我想说的是docker 就是 一个车的发动机引擎,引擎来提供动力,提供车上各个依赖引擎的组件使之运行,那么这里的组件就是容器.讲的

记一次Ubuntu19无法安装docker源

按照各大网站以及个人习惯我会使用下面这种方法添加Docker源: [email protected]:~# sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable" 然而使用上面这条命令给我带来了无尽的烦恼,甚至我都怀疑我是不是一个合格的linux工程师了,使用了这条命令提示以下错误: Ign:1 http

centos7 安装docker

最小化安装linux 关闭selinux编辑 /etc/selinux/config设定 SELINUX=disabled 重新启动 shutdown -r now 获取ip动态地址#dhclient 更新yum#yum -y update 安装ifconfig但是ifconfig在centos7上默认不在安装了,ifconfig属于net-tools包,而且vmtools必须要使用ifconfig这个命令,所以必须安装net-tools包,#yum -y install net-tools即可

解决CentOS7安装Tomcat不能被外部访问的问题

在CentOS7安装了Tomcat,在服务器内部使用火狐浏览器通过localhost:8080是可以访问的,但是不能被外部访问,主要原因是因为防火墙的存在,导致端口不能被访问.CentOS是使用firewall而不是iptables貌似也找不到iptables这个目录了.解决这个问题的办法就是通过firewall添加我们需要开放的端口.我们先使用一个命令查看防火墙是启用状态 firewall-cmd --state 如果启用了防火墙会返回running,未启用返回not running,在run