8000 Turn on Security opts including labeling for docker build by rhatdan · Pull Request #10186 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Turn on Security opts including labeling for docker build #10186

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

Merged
merged 1 commit into from
Feb 6, 2015

Conversation

rhatdan
Copy link
Contributor
@rhatdan rhatdan commented Jan 19, 2015

Currently docker build is not passing HostConfig to daemon.Create.
this patch creates the default HostConfig and passes it to daemon.Create.
This will cause the SELinux labeling to turn on for docker build. Basically
it causes a SecurtyOpt field to be created. In the future this might also
allow us to use seccomp and UserNamespace with docker build.

Docker-DCO-1.1-Signed-off-by: Dan Walsh dwalsh@redhat.com (github: rhatdan)

@cpuguy83
Copy link
Member

Seems like we can just pass an empty HostConfig struct to daemon.Create instead of storing it in the builder.

@rhatdan
Copy link
Contributor Author
rhatdan commented Jan 19, 2015

@cpuguy83 Does it matter, I would have to add import runconfig to internals.go. Is there something "stored" when I do a docker build?

@SvenDowideit
Copy link
Contributor

I feel the need for .... mmm, an selinux and docker colouring book.

@crosbymichael
Copy link
Contributor

LGTM

@rhatdan
Copy link
Contributor Author
rhatdan commented Jan 20, 2015

@SvenDowideit I have been thinking about creating a "Container" colouring book...

@cpuguy83
Copy link
Member

@rhatdan You're right, my only concern is people later coming and adding to b.HostConfig when it's not necessary, and instead handle this in daemon.Create:

if hostConfig == nil { 
    hostConifg = &runconfig.HostConfig{}
}

@rhatdan
Copy link
Contributor Author
rhatdan commented Jan 20, 2015

So you want something like this patch? @cpuguy83

@cpuguy83
Copy link
Member

@rhatdan That's my thought, yes.
As always, and I should have mentioned prior, IANTM.

@rhatdan
Copy link
Contributor Author
rhatdan commented Jan 20, 2015

We shall see what @crosbymichael
The biggest change here, is now anyone calling daemon.Create with a nil hostconfig will get securityopt turned on as opposed to us only turning this on for docker build. I am fine with the change.

@cpuguy83
Copy link
Member

Yeah, I was looking at the history of the API side of that. It would be older clients that would have a nil hostConfig, but I'm not sure that having a nil one would matter. Especially since it would get a hostConfig (even if empty) when it starts anyway.

@SvenDowideit
Copy link
Contributor

@rhatdan ❤️

Currently docker build is not passing HostConfig to daemon.Create.
this patch creates the default HostConfig and passes it to daemon.Create.
This will cause the SELinux labeling to turn on for docker build.  Basically
it causes a SecurtyOpt field to be created.  In the future this might also
allow us to use seccomp and UserNamespace with docker build.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
@crosbymichael
Copy link
Contributor

LGTM

1 similar comment
@LK4D4
Copy link
Contributor
LK4D4 commented Feb 6, 2015

LGTM

LK4D4 added a commit that referenced this pull request Feb 6, 2015
Turn on Security opts including labeling for docker build
@LK4D4 LK4D4 merged commit 6efecb7 into moby:master Feb 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0