Home > other >  Dockerfile yum command is not through
Dockerfile yum command is not through

Time:09-22

5/48 Step: RUN yum install - y GCC GCC - c + +
- & gt; Running in f810ab90a354
The Loaded plugins: fastestmirror


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=stock error was
14: curl# 6 - "Could not resolve host: mirrorlist.centos.org. Unknown error "
The command '/bin/sh -c yum install - y GCC GCC - c + +' returned a non - zero code: 1


My state of Docker is connected to the Internet, so can't wget download packages from the network, in the Docker to mount/dev/cdrom directory to/MNT/cdrom, so you can use local source of yum in the Docker, but in the Docker perform mount command fails,

Now can you tell me how can I use in the Dockerfile local source to perform yum yum command?


If have to use the network source of yum, can you tell me how to check whether the Docker container can be connected to the Internet?

CodePudding user response:

Yum has nothing to do with the Docker, your problem should be how to set up local private source,

CodePudding user response:

If the test of the container is connected to the Internet can be in the container starts, execute "docker exec - it [contianer_id] ping [address]"
But you have a problem overall mentality: the container it is best not to contain can change data, if you have to change the data, use volume solve, you should be in the build the image of the machine on the mount of your local yum source, then the docker file defined in the run yum XXXX, this will contain the image according to the content,

CodePudding user response:

Thank you very much for the two friends, also want to ask you how to create a private warehouse?
  • Related