-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
keep local dns in resolv.conf when host network enabled #4524
Conversation
feb6ead
to
a0571fc
Compare
a0571fc
to
991f910
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ updates needed per comments above
ab18978
to
032813c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
Signed-off-by: CrazyMax <[email protected]>
032813c
to
b550632
Compare
So late to the party here, but after some testing with buildx, I'm wondering if In this case, the custom network is reachable by IP, so I am assume that we are truely using host-mode for those Basically, this fix only works for the buildx Although I see now that was explicitly dismissed in #4524 (comment) so maybe the issue needs to be addressed on the buildx side, e.g., when a custom network is specified for a docker-container builder, it automatically allows the entitlement and inserts Or would a worker's explicit network mode carry through into the |
This is intentional. See #4524 (review) When network mode is unset then user should not make expectations about host DNS or interfaces being accessible by the container. Only thing they can expect is access to internet. Eg. we are changing the default to bridge #4352 in the future release for better security and to avoid collisions between containers.
Indeed, in a container context, I think we could allow daemon-side entitlement automatically because "host" there already means container-host, not machine-host. But no |
Yeah, I can see the logic of this on the BuildKit side. For buildx, the user is making an explicit request that the custom network be available to the build, so I guess that makes it a buildx responsibility. Perhaps buildx could actually hook the custom network up to a bridge, and just pass the bridge name in, taking advantage of #4352, and avoiding the "host-networking" in
I think this adds mild additional complexity simply because for a user building against a custom network, Anyway, this sounds like a buildx thing too, so I guess that answers my questions as far as this PR is concerned. Thank you. |
@crazy-max I have a question regarding this change: Where does the file |
As far as I can see, it should be generated the first time through |
It's not user-facing, just internal to handle cache for resolve conf in state dir. |
Ah, right, I misread the code. Thanks |
replaces and closes #3244
fixes #3210
related to docker/buildx#175 (comment)