From e511e6420fbd49a29f9e3bc3e3dcaae7ee57c37d Mon Sep 17 00:00:00 2001 From: waechtjn Date: Sat, 4 Jun 2022 14:31:48 +0100 Subject: [PATCH] FIXES #228: Add support for uidmap and gidmap Implement an x-podman extension on the level of the individual services to handle `--uidmap` and `--gidmap` --- podman_compose.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/podman_compose.py b/podman_compose.py index f1d1a0c..7ddfcbc 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1070,6 +1070,14 @@ def container_to_args(compose, cnt, detached=True): if "retries" in healthcheck: podman_args.extend(["--healthcheck-retries", str(healthcheck["retries"])]) + # handle podman extension + x_podman = cnt.get("x-podman", None) + if x_podman is not None: + for uidmap in x_podman.get("uidmaps", []): + podman_args.extend(["--uidmap", uidmap]) + for gidmap in x_podman.get("gidmaps", []): + podman_args.extend(["--gidmap", gidmap]) + podman_args.append(cnt["image"]) # command, ..etc. command = cnt.get("command", None) if command is not None: