Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS resolution failures in centos:7 arm64 container on m1 Mac #1788

Closed
chancez opened this issue Mar 11, 2022 · 5 comments · Fixed by lima-vm/lima#738, #1766 or #1829
Closed

DNS resolution failures in centos:7 arm64 container on m1 Mac #1788

chancez opened this issue Mar 11, 2022 · 5 comments · Fixed by lima-vm/lima#738, #1766 or #1829
Assignees
Projects
Milestone

Comments

@chancez
Copy link
Contributor

chancez commented Mar 11, 2022

Actual 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

@chancez chancez added the kind/bug Something isn't working label Mar 11, 2022
@github-actions github-actions bot added this to To do in Stripey via automation Mar 11, 2022
@chancez
Copy link
Contributor Author

chancez commented Mar 11, 2022

So after some discussion, I found I can disable the lima hostResolver "proxy" (stub resolver?) and that seems to have worked-around the issue.

Eg: putting:

hostResolver:
  enabled: false

Into ~/Library/Application\ Support/rancher-desktop/lima/_config/override.yaml

I'm going to try turning it back on with ipv6 enabled, as that could also be a potential issue.

@chancez
Copy link
Contributor Author

chancez commented Mar 11, 2022

This worked when I re-enabled the hostResolver and enabled ipv6 support for it. Based on a discussion in the rancher-desktop slack channel, it seems the behavior of the lima hostagent may be incorrect. https://rancher-users.slack.com/archives/C0200L1N1MM/p1647014048690489 for details.

@gaktive gaktive added this to the Next milestone Mar 15, 2022
@gaktive gaktive moved this from To do to In progress in Stripey Mar 15, 2022
@chancez
Copy link
Contributor Author

chancez commented Mar 15, 2022

@Nino-K
Copy link
Member

Nino-K commented Mar 16, 2022

Going to close this, please feel free to reopen if the issue still exists. @chancez thanks for your contribution.

@Nino-K Nino-K closed this as completed Mar 16, 2022
@jandubois jandubois moved this from In progress to Review in Stripey Mar 17, 2022
@jandubois jandubois moved this from Review to Done in Stripey Mar 17, 2022
@fweimer-rh
Copy link

I could reproduce this issue on the s390x port of Red Hat Enterprise Linux and filed bug 2065058. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment