From e8147e350b0441bdbcc82e5b4fd4f09d6cb44ecf Mon Sep 17 00:00:00 2001 From: Bao Trinh Date: Fri, 29 Nov 2019 18:45:35 -0600 Subject: [PATCH] Add support for cap_add/cap_drop Currently, `cap_add` and `cap_drop` are being ignored by podman-compose. Add the arguments (`--cap-add` and `--cap-drop`, respectively) to `podman create` when appropriate. --- podman_compose.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/podman_compose.py b/podman_compose.py index 0eac420..f2fd423 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -525,6 +525,10 @@ def container_to_args(compose, cnt, detached=True, podman_command='run'): if net: podman_args.extend(['--network', net]) env = norm_as_list(cnt.get('environment', {})) + for c in cnt.get('cap_add', []): + podman_args.extend(['--cap-add', c]) + for c in cnt.get('cap_drop', []): + podman_args.extend(['--cap-drop', c]) for d in cnt.get('devices', []): podman_args.extend(['--device', d]) for e in env: