Skip to content

Commit

Permalink
podman_compose.py: support "platform" property in the build command
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bkueng authored and p12tic committed Jul 26, 2024
1 parent dbbd695 commit b3c49df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions newsfragments/build-platform.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for "platform" property in the build command.
2 changes: 2 additions & 0 deletions podman_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", []):
Expand Down

0 comments on commit b3c49df

Please sign in to comment.