Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Resolve the Centos7 installation docker source problem

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

According to the official document: https://docs.docker.com/install/linux/docker-ce/centos/ to build docker

1. Uninstall the old version of 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\

two。 Install related tool classes:

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

3. Configure the docker repository:

Sudo yum-config-manager\-- add-repo\ https://download.docker.com/linux/centos/docker-ce.repo

The following error will be reported: 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

This is due to the lack of access to the official docker image in China.

This can be done through the source of aliyun:

Sudo yum-config-manager-- add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

The following indicates that the docker repository is configured successfully:

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. Install docker

Sudo yum install docker-ce

The following exception occurred:

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-x86x64)

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"

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

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report