[WIP] Cli: Support --cap-add, --cap-drop and --privileged on services#2199
[WIP] Cli: Support --cap-add, --cap-drop and --privileged on services#2199olljanat wants to merge 3 commits intodocker:masterfrom
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 createdocker service updateCloses 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.