Skip to content

Commit b3c49df

Browse files
bkuengp12tic
authored andcommitted
podman_compose.py: support "platform" property in the build command
This was already added to container_to_args() in #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 <[email protected]>
1 parent dbbd695 commit b3c49df

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

newsfragments/build-platform.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added support for "platform" property in the build command.

podman_compose.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,8 @@ async def build_one(compose, args, cnt):
23752375
if not os.path.exists(dockerfile):
23762376
raise OSError("Dockerfile not found in " + ctx)
23772377
build_args = ["-f", dockerfile, "-t", cnt["image"]]
2378+
if "platform" in cnt:
2379+
build_args.extend(["--platform", cnt["platform"]])
23782380
for secret in build_desc.get("secrets", []):
23792381
build_args.extend(get_secret_args(compose, cnt, secret, podman_is_building=True))
23802382
for tag in build_desc.get("tags", []):

0 commit comments

Comments
 (0)