Home > other >  Docker build mirror problems for help
Docker build mirror problems for help

Time:09-20

As title, sincerely, thanked you, have met or ace, please feel free to comment the question is how to solve!
To the point:
Environmental:
Distributor ID: CentOS
Description: CentOS release 6.7 (Final)
Release: 6.7
Dockerfile:
# Version: 0.0.1
The FROM centos
MAINTAINER SQL "[email protected]
"The RUN yum -y install nginx
The RUn echo 'I am in your container! '
EXPOSE 80
description:
Preliminary doubt is yum server network is normal, the source problem, but a separate execution "yum - y install nginx" normal, baidu,
error:
Sending the build context to Docker daemon 4.096 kB
Sending the build context to Docker daemon
Step 0: the FROM centos
- & gt; E74c56fbba84
Step 1: MAINTAINER SQL "[email protected]
"- & gt; Using cache
- & gt; 978 c5cb493dc
Step 2: RUN yum -y install nginx
- & gt; Running in 568 c25bd90dc
The Loaded plugins: fastestmirror, ovf


One of the configured repositories failed (Unknown),
And yum doesn 't have the enough cached data to continue. At this point the only
Safe thing yum can do is fail. There are what ways to the work of "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
Most upstream. This is, useful if you are using a newer
Distribution release than is supported by the repository (and the
Packages for the previous distribution release, the work).

3. Run the command with the repository temporarily disabled
Yum - disablerepo=& lt; Repoid> .

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 the or use - enablerepo for temporary usage:

Yum - config manager - disable & lt; Repoid>
Or
Subscription - manager repos - disable=& lt; Repoid>

5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. Most of the when it runs commands,
So will have to try and fail each time (and thus the yum will be be much
Slower). If it is a very temporary problem my, this is, a nice
Compromise:

Yum - config manager - save - setopt=& lt; Repoid> . Skip_if_unavailable=true

Always find a valid baseurl for repo: 7/base/x86_64
Could not retrieve mirrorlist HTTP://http://mirrorlist.centos.org/? Release=7 & amp; The arch=x86_64 & amp; Repo=os& Infra=container error was
12: the Timeout on http://mirrorlist.centos.org/? Release=7 & amp; The arch=x86_64 & amp; Repo=os& Infra=container: (28, 'Resolving timed out after 30546 milliseconds')
The command '/bin/sh - c yum - y install nginx' returned a non - zero code: 1

CodePudding user response:

Docker default are opportunities ubuntu, you can use yum? Debian, ubuntu apt management package,

CodePudding user response:

Hello! Thank you, I am using rhel, system version is centos7 useless ubuntu,

CodePudding user response:

refer to the second floor sunqingliang1 response:
hello! Thank you, I am using rhel, system version is centos7 useless ubuntu.

I mean, is the docker instances of Linux template, what you said is also within the docker system?

CodePudding user response:

You mean instance is the basis of the docker container mirror? I want to use centos is, the result is submitted to the above error, now I changed the base image to try Ubuntu

CodePudding user response:

The
reference 4 floor sunqingliang1 reply:
do you mean instance is the basis of the docker container mirror? I want to use centos is, the result is submitted to the above error, now I changed the base image to try Ubuntu

I'm sorry, I didn't see clear, dockerfile is from centos, I just tried, you can see this
Dockerfile with directory, I literally the whole file a.t xt
[nginx]
 
Name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
Gpgcheck=0
Enabled=1

Dockerfile I literally a name test. TXT
 # Version: 0.0.1 
The FROM centos
MAINTAINER SQL "[email protected]
"The RUN yum - y update
The ADD a.t xt/etc/yum. Repos. D/nginx. '
The RUN yum -y install nginx
The RUn echo 'I am in your container! '
EXPOSE 80


Literally into a directory, centos more than 70 M, the down time is a bit slow
 sudo docker build -t centos123: IMG - f/home/upload/tomcat/server/PFMS/test. TXT/home/upload/tomcat/server/PFMS 



You try


CodePudding user response:

Or not, I read the newspaper in the wrong meaning should be a source of the problem?

CodePudding user response:

An error log contains a always find a valid baseurl for repo: base/seven/x86_64
Could not retrieve mirrorlist HTTP://http://mirrorlist.centos.org/? Release=7 & amp; The arch=x86_64 & amp; Repo=os& Infra=container error was

CodePudding user response:

refer to 6th floor sunqingliang1 response:
or not, I read the newspaper should be a source of the problem?

Yes, I'm adding the source later success,

CodePudding user response:

 
Sudo docker build -t centos123: IMG - f/home/upload/tomcat/server/PFMS/test. TXT/home/upload/tomcat/server/PFMS
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related