Skip to content

Add support for --cap-add and --cap-drop - #6968

Merged
crosbymichael merged 9 commits into
moby:masterfrom
vieux:cap_add_drop
Jul 14, 2014
Merged

crosbymichael merged 9 commits into
moby:masterfrom
vieux:cap_add_drop

Conversation

@vieux

@vieux vieux commented Jul 11, 2014

Copy link
Copy Markdown
Contributor

Linked to #6687

@vieux

vieux commented Jul 11, 2014

Copy link
Copy Markdown
Contributor Author

ping @crosbymichael @unclejack @rhatdan

@vieux

vieux commented Jul 11, 2014

Copy link
Copy Markdown
Contributor Author

TESTFLAGS="-run TestCap*" make test-integration-cli

@crosbymichael

Copy link
Copy Markdown
Contributor

LGTM

@cyphar

cyphar commented Jul 11, 2014

Copy link
Copy Markdown
Contributor

Can we make them comma-separated lists? This would make using the command line much nicer (such as docker run --cap-add=MKNOD,NET_ADMIN <image> which would add both the MKNOD and NET_ADMIN capabilities -- same thing for --cap-drop).

Comment thread docs/sources/reference/run.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capability(ies)? I'd just use capabilities. The plural can mean one or more. Ditto next line.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree a comma separated list of CAPABILIITES.

@crosbymichael

Copy link
Copy Markdown
Contributor

No i don't agree on a comma separated list. It is inconsistent with every other flag that we have, -p, -v.

@unclejack

Copy link
Copy Markdown
Contributor

+1 for passing multiple --cap--add somecap and --cap-drop somecap arguments more than once to specify multiple caps. Passing lists of caps would break consistency with everything else.

Making it possible to pass multiple caps as a list would mean that we have to change this everywhere to have a consistent behavior.

@tiborvass

Copy link
Copy Markdown
Contributor

I also think we need to be consistent. If we want commas, that should be a separate issue/PR.

@tiborvass

Copy link
Copy Markdown
Contributor

LGTM
ping @unclejack

@unclejack

Copy link
Copy Markdown
Contributor

LGTM

@tiborvass

Copy link
Copy Markdown
Contributor

Docs ping @fredlf @jamtur01 @SvenDowideit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentence doesn't make sense. Perhaps:

The hostConfig option now accepts the field CapAdd, which specifies a list of capabilities to add, and the field CapDrop, which specifies a list of capabilities to drop.

@jamtur01

Copy link
Copy Markdown
Contributor

LGTM

vieux added 8 commits July 11, 2014 23:43
Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an artifact from a merge conflict?

@fredlf

fredlf commented Jul 12, 2014

Copy link
Copy Markdown
Contributor

LGTM after my two comments are addressed.

@vieux

vieux commented Jul 12, 2014

Copy link
Copy Markdown
Contributor Author

@fredlf done :)

Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
@SvenDowideit

Copy link
Copy Markdown
Contributor

LGTM - though I'd like a few practical examples of when or why you'd use them.

crosbymichael pushed a commit that referenced this pull request Jul 14, 2014
Add support for --cap-add and --cap-drop
@crosbymichael
crosbymichael merged commit 7ebd49c into moby:master Jul 14, 2014
kanzure added a commit to kanzure/fig that referenced this pull request Oct 13, 2014
This adds support for the following yaml syntax:

    service:
        caps:
            add:
            - SYS_NICE

            drop:
            - NET_RAW

--cap-add and --cap-drop was added to docker:
moby/moby#6968

Also this feature has been added to docker-py:
docker/docker-py#314
kanzure added a commit to kanzure/fig that referenced this pull request Oct 13, 2014
This adds support for the following yaml syntax:

    service:
        caps:
            add:
            - SYS_NICE

            drop:
            - NET_RAW

--cap-add and --cap-drop was added to docker:
moby/moby#6968

Also this feature has been added to docker-py:
docker/docker-py#314
kanzure added a commit to kanzure/fig that referenced this pull request Oct 13, 2014
This adds support for the following yaml syntax:

    service:
        caps:
            add:
            - SYS_NICE

            drop:
            - NET_RAW

--cap-add and --cap-drop was added to docker:
moby/moby#6968

Also this feature has been added to docker-py:
docker/docker-py#314

Signed-off-by: Bryan Bishop <[email protected]>
kanzure added a commit to kanzure/fig that referenced this pull request Oct 13, 2014
This adds support for the following yaml syntax:

    service:
        caps:
            add:
            - SYS_NICE

            drop:
            - NET_RAW

--cap-add and --cap-drop was added to docker:
moby/moby#6968

Also this feature has been added to docker-py:
docker/docker-py#314

Signed-off-by: Bryan Bishop <[email protected]>
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.

9 participants