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

Add config options that allow container DNS to point to localhost #3210

Closed
tonistiigi opened this issue Oct 21, 2022 · 7 comments · Fixed by #4524
Closed

Add config options that allow container DNS to point to localhost #3210

tonistiigi opened this issue Oct 21, 2022 · 7 comments · Fixed by #4524

Comments

@tonistiigi
Copy link
Member

Currently, the localhost nameservers are removed and replaced with default nameservers if needed because it is assumed that internal containers can't access localhost nameservers anyway. But this may not be true if deployment reuses host networking for internal containers by default(that is fine if the whole daemon is already inside a container sandbox). We could add a config option to control this behavior.

ref docker/buildx#1347

@tonistiigi
Copy link
Member Author

f, err = resolvconf.FilterResolvDNS(dt, true)
if err != nil {
return "", err
}
should be the specific call that currently removes localhost records.

@ch33hau
Copy link

ch33hau commented Oct 21, 2022

Hi @tonistiigi, can I try to work on this issue?

@tonistiigi
Copy link
Member Author

@ch33hau Sure

@ch33hau
Copy link

ch33hau commented Oct 26, 2022

Hi @tonistiigi,

Now I see how it works and is able to reproduce it.

But I have a few questions before I can proceed.

Am I right that the new config option should be available on docker buildx build, and docker buildx bake can override it with the --set option?

And what should be the option name? I am thinking no-local-dns or remove-local-dns and defaults to true, is that ok?

@tonistiigi
Copy link
Member Author

We might not even require new config option. Just when https://github.com/moby/buildkit/blob/master/cmd/buildkitd/config/config.go#L53 is host the DNS from localhost should work as well.

@ch33hau
Copy link

ch33hau commented Oct 31, 2022

Hi @tonistiigi , I have created a draft PR #3244 with some questions there. Could you please take a look and see if I am on the right track?

Thanks a lot!

@polarathene
Copy link
Contributor

when https://github.com/moby/buildkit/blob/master/cmd/buildkitd/config/config.go#L53 is host

For reference since that wasn't a permalink and line has shifted since:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants