When executing yum in dockerfile or in the container, an error is reported and the source cannot be found (invalid baseurl xxx), but there is no problem executing yum on the host machine. Why? Because no matter whether Dockerfile uses the RUN keyword to execute yum or directly enters the container to execute yum, they all use the source in the Docker image (CentOS is in the path /etc/yum.repo.d/CentOS-Base.repo), so you have to copy the source in the same path on the host machine to the container, and then docker commit a new "base image". At this time, using docker build xxx (that is, using the Dockerfile method) will not report an error. Copy method: docker cp xxx xxx Content Extension Error when executing yum operation in dockerfile Let’s first look at the error message:
Solution: You just need to add the DNS service to the resolv.conf file. This file is in /etc. Add
That's it This is the end of this article about how to solve the error when calling yum from a docker container. For more information about how to solve the error when calling yum from a docker container, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Pure JavaScript to implement the number guessing game
>>: MySQL uses custom functions to recursively query parent ID or child ID
Preface In the past, I always switched Python ver...
When installing the centos7 version, choose to co...
The main differences are as follows: 1. MySQL use...
Preparation 1. The master and slave database vers...
1. Environmental requirements 1. Docker 17 and ab...
Linux server hosts file configuration The hosts f...
Harbor Harbor is an open source solution for buil...
Let's first look at the basic syntax of the c...
cursor The set of rows returned by the select que...
Browser compatibility is nothing more than style ...
Table of contents Preface 1. What is selenium? 2....
Table of contents Events in js Event Type Common ...
1. Install tools and libraries # PCRE is a Perl l...
Implementation ideas: First of all, the alarm inf...
MySQL 5.7 MySQL command line client using command...