DNS resolution failures in centos:7 arm64 container on m1 Mac
See original GitHub issueActual Behavior
When trying to build a container based on centos:7
on my m1 Mac, it fails on most yum
commands due to a DNS resolution failure:
Could not resolve host: mirrorlist.centos.org; Unknown error
Steps to Reproduce
Dockerfile:
FROM centos:7
RUN yum update -y && yum install -y curl
docker buildx build --platform linux/arm64 -t test-centos-dns -f Dockerfile
Result
[+] Building 11.1s (5/5) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 47B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/centos:7 0.0s
=> CACHED [1/2] FROM docker.io/library/centos:7 0.0s
=> ERROR [2/2] RUN yum update -y && yum install -y curl 11.0s
------
> [2/2] RUN yum update -y && yum install -y curl:
#0 0.369 Loaded plugins: fastestmirror, ovl
#0 0.427 Determining fastest mirrors
#0 10.98 Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=aarch64&repo=os&infra=container error was
#0 10.98 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
#0 10.99
#0 10.99
#0 10.99 One of the configured repositories failed (Unknown),
#0 10.99 and yum doesn't have enough cached data to continue. At this point the only
#0 10.99 safe thing yum can do is fail. There are a few ways to work "fix" this:
#0 10.99
#0 10.99 1. Contact the upstream for the repository and get them to fix the problem.
#0 10.99
#0 10.99 2. Reconfigure the baseurl/etc. for the repository, to point to a working
#0 10.99 upstream. This is most often useful if you are using a newer
#0 10.99 distribution release than is supported by the repository (and the
#0 10.99 packages for the previous distribution release still work).
#0 10.99
#0 10.99 3. Run the command with the repository temporarily disabled
#0 10.99 yum --disablerepo=<repoid> ...
#0 10.99
#0 10.99 4. Disable the repository permanently, so yum won't use it by default. Yum
#0 10.99 will then just ignore the repository until you permanently enable it
#0 10.99 again or use --enablerepo for temporary usage:
#0 10.99
#0 10.99 yum-config-manager --disable <repoid>
#0 10.99 or
#0 10.99 subscription-manager repos --disable=<repoid>
#0 10.99
#0 10.99 5. Configure the failing repository to be skipped, if it is unavailable.
#0 10.99 Note that yum will try to contact the repo. when it runs most commands,
#0 10.99 so will have to try and fail each time (and thus. yum will be be much
#0 10.99 slower). If it is a very temporary problem though, this is often a nice
#0 10.99 compromise:
#0 10.99
#0 10.99 yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
#0 10.99
#0 10.99 Cannot find a valid baseurl for repo: base/7/aarch64
------
error: failed to solve: executor failed running [/bin/sh -c yum update -y && yum install -y curl]: exit code: 1
Expected Behavior
No DNS failure
Additional Information
No response
Rancher Desktop Version
1.1.1
Rancher Desktop K8s Version
n/a
Which container runtime are you using?
moby (docker cli)
What operating system are you using?
macOS
Operating System / Build Version
Darwin dune.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000 arm64
What CPU architecture are you using?
arm64 (Apple Silicon)
Linux only: what package format did you use to install Rancher Desktop?
No response
Windows User Only
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
UTM: Run Virtual Machines on Your Apple Silicon M1 Mac ...
Here, select ARM64 (aarch64) as the architecture, and select at least half of your system's memory for the virtual machine. For an M1...
Read more >Why new Macs break your Docker build, and how to fix it
The cause of the problem: a different CPU instruction set. Solving the problem by ensuring the code is installable or compilable. Solving ...
Read more >Why is docker-compose failing with ERROR internal load ...
I think this has to do with issues trying to load the meta data of the image specified in the dockerfile from the...
Read more >Install Kali Linux on Apple M1 with UTM [100% Working]
Download and Install UTM; Download Kali Linux ARM image; Importing Kali ARM image into UTM; Install Kali Linux; Fix display resolution and remove...
Read more >Chef Workstation Release Notes
Resolved failures when using cookbooks defined in a Policyfile with ChefSpec. ... We now produce macOS packages for Chef Workstation macOS for Intel...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I could reproduce this issue on the s390x port of Red Hat Enterprise Linux and filed bug 2065058. Thanks.
Going to close this, please feel free to reopen if the issue still exists. @chancez thanks for your contribution.