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: