-
Notifications
You must be signed in to change notification settings - Fork 1.3k
solver: net host with basic entitlements support #560
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
Conversation
cmd/buildctl/build.go
Outdated
@@ -76,6 +77,10 @@ var buildCommand = cli.Command{ | |||
Name: "secret", | |||
Usage: "Secret value exposed to the build. Format id=secretname,src=filepath", | |||
}, | |||
cli.StringSliceFlag{ | |||
Name: "allow", | |||
Usage: "Allow extra privileged entitlement", |
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.
Allow extra privileged entitlement, e.g. network.host, security.unconfined
?
client/client_test.go
Outdated
defer c.Close() | ||
|
||
st := llb.Image("busybox:latest"). | ||
Run(llb.Shlex(`sh -c 'ping -c 1 8.8.8.8 2>&1 | grep "Network is unreachable"'`), llb.Network(llb.NetModeNone)) |
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.
wget https://example.com
? (ping does not work for unprivileged users by default)
lint failure
|
For my entitlements work, I took relevant code from Was stuck on how to pass the flags to buildkit worker, this PR will help me. |
Signed-off-by: Kunal Kushwaha <[email protected]>
Signed-off-by: Kunal Kushwaha <[email protected]>
555c8ff
to
e62a6b0
Compare
Signed-off-by: Tonis Tiigi <[email protected]>
Signed-off-by: Tonis Tiigi <[email protected]>
This adds capabilities for configuring networking modes to support network=none in llb and
--net=host
,--net=none
in Moby Dockerfiles.In order to implement it, I needed to do some basic preparation for entitlements. cc @kunalkushwaha PTAL . There are no entitlements in llb yet, nor any support for the
security.unconfined
, nor daemon config but I created the base package to run the validation.network.host
is disabled atm globally https://github.com/moby/buildkit/pull/560/files#diff-d2a8a37b660c457a954dfeae935c476eR246. In the end, it could be configurable from daemon config but this is enough for Moby integration the enable it if needed.Based on #556