[Solved] dockerfile Build Image Error: Error: Failed to download metadata for repo ‘appstream’…

Error content

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

Solution:

Modify the dockerfile file and add the following red box content

Finally, the docker image is successfully built
It is estimated that there is a problem with some Yum sources of centos8

Reference
https://stackoverflow.com/questions/70963985/error-failed-to-download-metadata-for-repo-appstream-cannot-prepare-internal

Read More: