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
The default program publishing path of tomcat7 is...
This article mainly introduces: using Vue to impl...
Table of contents Basic Selector Extensions Attri...
The specific code for implementing skinning with ...
HTML meta tag HTML meta tags can be used to provi...
After I analyzed the Taobao details page last time...
theme Today I will teach you how to create a circ...
Table of contents 1. Overview 2. Digital Enumerat...
This article example shares the specific code for...
Table of contents 1. Ubuntu source change 2. Inst...
Referring to the online information, I used cmake...
Use the following command to check whether MySQL ...
1. Installation environment 1. HUAWEI mate x cpu ...
Table of contents As attribute and property value...
Prerequisites 1. Docker has been installed on the...