Skip to content

Commit a45ebc6

Browse files
committed
Specify "--platform linux/amd64" in build-tools/docker/build.py, so that it doesn't try building arm64 on arm-based macs. Make sure the resulting version tags always start with "v".
1 parent 2a9c198 commit a45ebc6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

build-tools/docker/build.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ def build_docker_image(dockerfile_path, image_name, tags, num_jobs=None):
3434
if num_jobs:
3535
command += f" --build-arg NUM_JOBS={num_jobs}"
3636

37+
# Force the amd64 platform in case we're building on an arm-based one.
38+
command += " --platform linux/amd64"
39+
3740
# Note: "plain" output is more verbose, but it makes it easier to understand what went wrong
3841
# when a problem occurs.
3942
command += " --progress=plain"
@@ -127,6 +130,10 @@ def main():
127130
args = parser.parse_args()
128131

129132
version = args.version if args.version else get_cargo_version("Cargo.toml")
133+
# Note: the CI currently takes the version from the release tag, so it always starts with "v",
134+
# but the version from Cargo.toml doesn't have this prefix.
135+
version = version if version.startswith('v') else f"v{version}"
136+
130137
tags = [version, *args.local_tags]
131138

132139
if args.build:

0 commit comments

Comments
 (0)