buildkit: Buildkit does not configure DNS correctly inside container
For a project, I enabled DOCKER_BUILDKIT="1".
When building, I get wget: bad address 'my.company.com'.
The offending line is:
RUN wget http://my.company.com/foobar.txt
I am not really sure, why this does not work. Other lines like apk add --no-cache git work fine in contrast.
When experimenting, I get a similar error with:
RUN go mod download
And this works fine both on the host and when not using Buildkit.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (5 by maintainers)
cat /etc/resolv.confon host prints:so this might be related to https://github.com/docker/libnetwork/issues/1654!?
In the container it prints:
which seems to miss the local and company DNS Servers.
Seems to fix the problem 🎉 6. Output:
This is probably one factor. On the other hand, Buildkit IMO definitely has a bug where it handles resolv.conf different than legacy Docker (with the latter working fine).