Skip to content

invalid bake configuration #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Fixed

- Invalid 'buildx bake' configuration file generated due to architecture not being a list anymore. ([#13])

[#13]: https://github.com/stackabletech/image-tools/pull/13

## [0.0.6] - 2024-04-24

### Changed
Expand Down
1 change: 0 additions & 1 deletion src/image_tools/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def bake_args() -> Namespace:
"-a",
"--architecture",
help="Target platform for image. Default: linux/amd64.",
nargs="+",
default="linux/amd64",
type=check_architecture_input,
)
Expand Down
15 changes: 7 additions & 8 deletions src/image_tools/bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def bakefile_product_version_targets(
"dockerfile": f"{product_name}/Dockerfile",
"tags": tags,
"args": build_args,
"platforms": args.architecture,
"platforms": [args.architecture],
"context": ".",
"contexts": {
f"stackable/image/{name}": f"target:{bakefile_target_name_for_product_version(name, version)}"
Expand Down Expand Up @@ -142,15 +142,14 @@ def bake_command(args: Namespace, targets: List[str], bakefile) -> Command:
For local building, builder instances are supported.
"""

if args.push:
target_mode = ["--push"]
elif len(args.architecture) == 1:
target_mode = ["--load"]
else:
target_mode = []

if args.dry:
target_mode = ["--print"]
else:
if args.push:
target_mode = ["--push"]
else:
target_mode = ["--load"]


return Command(
args=[
Expand Down
Loading