From b3c49df6ebd72fc2f04382bffb0fcf0b50e454e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Mon, 22 Jul 2024 15:07:13 +0200 Subject: [PATCH] podman_compose.py: support "platform" property in the build command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was already added to container_to_args() in https://github.com/containers/podman-compose/pull/470 which is used for the 'up' and 'run' commands. Definition in the schema: https://github.com/compose-spec/compose-spec/blob/main/schema/compose-spec.json#L329 Signed-off-by: Beat Küng --- newsfragments/build-platform.feature | 1 + podman_compose.py | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 newsfragments/build-platform.feature diff --git a/newsfragments/build-platform.feature b/newsfragments/build-platform.feature new file mode 100644 index 00000000..d19de680 --- /dev/null +++ b/newsfragments/build-platform.feature @@ -0,0 +1 @@ +Added support for "platform" property in the build command. diff --git a/podman_compose.py b/podman_compose.py index 35c4aa59..a324e137 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -2375,6 +2375,8 @@ async def build_one(compose, args, cnt): if not os.path.exists(dockerfile): raise OSError("Dockerfile not found in " + ctx) build_args = ["-f", dockerfile, "-t", cnt["image"]] + if "platform" in cnt: + build_args.extend(["--platform", cnt["platform"]]) for secret in build_desc.get("secrets", []): build_args.extend(get_secret_args(compose, cnt, secret, podman_is_building=True)) for tag in build_desc.get("tags", []):