-
Notifications
You must be signed in to change notification settings - Fork 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
[WIP] Cli: Support --cap-add, --cap-drop and --privileged on services #2199
Conversation
Signed-off-by: Olli Janatuinen <[email protected]>
Signed-off-by: Olli Janatuinen <[email protected]>
Signed-off-by: Olli Janatuinen <[email protected]>
b5108ee
to
341dadf
Compare
Hi @olljanat I need this feature to get "jmap" working on my container using image "gettyimages/spark:2.2.1-hadoop-2.7" and deployed using docker swarm. I followed your suggestion by downloading your docker-cli program from https://github.com/olljanat/cli/releases/download/beta1/docker and latest (nightly) versions of the rest. When I try to run "service update" it seems to work but it does not enable required capability on my service (SYS_PTRACE):
These are my versions (I have only upgraded one node with docker versions): appusr@od-node0:~/docker$ docker version Server: Docker Engine - Community Any suggestions? |
@fmiguelez you can use my ollijanatuinen/capsh image to see that capabilities are really updated. It run command Then comes to your "jmap" issue check first that you get it working with |
@olljanat Hi Here are some info that might help investigate the problem:
Note 1:
|
@information-security if you have multiple swarm nodes then you must update dockerd to all of them. Other why you cannot use API version 1.41 which is needed by this. Latest code even give warnings about it but you don't see it because that test binary was built before I added that logic. If that does not help then plz ping me on Docker community Slack. I want keep this discussion clear for maintainers who do actual code review. |
- What I did
docker service create
docker service update
Closes moby/moby#25885 moby/moby#24862 moby/swarmkit#1030
- How I did it
Included logic which converts -cap-add, --cap-drop and --privileged flags to exact capabilities list
- How to verify it
Create service based on default capabilities with minor adjustments:
Update capabilities for existing service:
Create service with all capabilities and drop some capabilities from it:
- A picture of a cute animal (not mandatory but encouraged)

WIP because based on #1940 and it needs to be merged first.