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
Or write down the installation process yourself! ...
Every visit will generate Cookie in the browser, ...
Preface: When we need to store decimals and have ...
This article uses an example to illustrate the me...
Section Course content Hours 1 Web Design Overvie...
Copy code The code is as follows: <span style=...
This article records the installation and configu...
Table of contents 1. Data Type 1. What is MySQL s...
Introduction By enabling the slow query log, MySQ...
Preface "High Performance MySQL" mentio...
Precautions 1) Add interpreter at the beginning: ...
First create a directory cd /etc/nginx mkdir ssl ...
Table of contents Short Introduction 1. Check the...
Without further ado, let’s get started with resou...
Table of contents 1. Is setState synchronous? asy...