-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 not working when building Dockerfiles FROM alpine:3.13 only in minikube #10830
Comments
OKay, minutes after posting this I found: Which is probably related. |
What does A normal virtualbox setup has an internal _ _
_ _ ( ) ( )
___ ___ (_) ___ (_)| |/') _ _ | |_ __
/' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)
$ more /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 10.0.2.3
|
I should also mention that systemd hates the virtualbox servers (both DHCP and DNS) Basically we had to patch it, because it crashed with some of the responses that it got... |
I checked that and should have put it in the issue: The So it looks like the virtualbox set-up is as expected, and the Thank you for the heads-up about systemd & virtualbox DHCP/DNS servers, I'll keep it in mind in the future wapiflapi@box:~$ minikube ssh
_ _
_ _ ( ) ( )
___ ___ (_) ___ (_)| |/') _ _ | |_ __
/' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)
$ cat /etc/issue /etc/resolv.conf
Welcome to minikube
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 10.0.2.3
$
$ docker run -it alpine:3.13 cat /etc/issue /etc/resolv.conf
Welcome to Alpine Linux 3.13
Kernel \r on an \m (\l)
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 10.0.2.3
$
$ docker run -it alpine:3.13 ping google.com
ping: bad address 'google.com' |
If I call correctly, there were also some quirks when it came to musl and resolving Alpine uses a different C library, and sometimes it behaves differently The bug repeats here (on Ubuntu), it works on the host but not in the minikube VM.
$ ping -c 3 google.com
PING google.com (216.58.207.238): 56 data bytes
64 bytes from 216.58.207.238: seq=0 ttl=63 time=15.600 ms
64 bytes from 216.58.207.238: seq=1 ttl=63 time=16.222 ms
64 bytes from 216.58.207.238: seq=2 ttl=63 time=19.676 ms
--- google.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 15.600/17.166/19.676 ms
$ docker run -it alpine:3.13 ping -c 3 google.com
Unable to find image 'alpine:3.13' locally
3.13: Pulling from library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for alpine:3.13
ping: bad address 'google.com'
$ docker run -it debian ping -c 3 google.com
Unable to find image 'debian:latest' locally
latest: Pulling from library/debian
e22122b926a1: Pull complete
Digest: sha256:9d4ab94af82b2567c272c7f47fa1204cd9b40914704213f1c257c44042f82aac
Status: Downloaded newer image for debian:latest
PING google.com (216.58.207.238) 56(84) bytes of data.
64 bytes from arn09s19-in-f14.1e100.net (216.58.207.238): icmp_seq=1 ttl=61 time=13.10 ms
64 bytes from arn09s19-in-f14.1e100.net (216.58.207.238): icmp_seq=2 ttl=61 time=20.1 ms
64 bytes from arn09s19-in-f14.1e100.net (216.58.207.238): icmp_seq=3 ttl=61 time=16.0 ms
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 5ms
rtt min/avg/max/mdev = 13.950/16.694/20.114/2.563 ms |
Docker Machine has flags to toggle this:
They are available in Minikube as well, as:
The machine ticket references these: https://gitlab.alpinelinux.org/alpine/aports/-/issues/6221 https://www.virtualbox.org/ticket/18171 So it looks like yet another unhappy DNS customer |
When alpine 3.13 was released I had breaking changes when building in minikube. In general I think it's better to have fixed version so that if it works it doesn't break. See kubernetes/minikube#10830 for the discussion about the original / upstream bug.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
So I ran into this again today while building from a Dockerfile utilizing alpine 3.14 and found no combination of flags between I also tried and couldn't find any working ENV vars or switches for I did find two ways through modifying docker daemon's dns setting or overwriting /etc/resolv.conf in the RUN step. Because docker daemon tries to use the host, one could probably just change the minikube VM's resolv configuration but I did not succeed in doing so. Here is modifying daemon's dns setting. Affects future docker commands. Ported from this answer for minikube like so:
Then the build succeeded. Here is overwriting the /etc/resolv.conf in the RUN step: As described in this answer I can confirm that by prefixing my RUN command with This is nice because it only affects the area that needs it, but requires modification of the Dockerfile itself. |
Ran into this issue and pinning my docker build to Apline v 3.12 worked as per this. |
@r4j4h I ran into same issue with docker in minikube, updating daemon.json by ssh worked like charm! Thanks. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I was investigating broken docker builds because of DNS issues and narrowed it down to building
FROM alpine:3.13
specifically on minikube inside virtualbox. So I don't know if this is the right place for this bug report.Starting with a fresh minikube / virtualbox install:
Testing with
debian
also doesn't show DNS issues.What makes me think this might be a minikube issue is the fact that running the same commands on the host (Ubuntu / Pop!_OS 20.10 ) works as expected:
I'm not sure how to further investigate this, or if I should submit this as a bug report at alpine?
The text was updated successfully, but these errors were encountered: