Skip to content

Commit 2ab49fd

Browse files
authored
fix: add universal image to build and push list (#329)
* fix: add universal image to build and push list The universal image was added in #307 but never included in the IMAGES array in scripts/images.sh, so it was never built or pushed to Docker Hub. * fix: support per-image platform override, restrict universal to amd64 The devcontainers/universal base image is amd64-only. Add support for a .platforms file per image directory to override the default multi-arch platform list.
1 parent 28e8466 commit 2ab49fd

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

images/universal/.platforms

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
linux/amd64

scripts/build_images.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ if [ $QUIET = true ]; then
8888
)
8989
fi
9090

91+
DEFAULT_PLATFORM="linux/amd64,linux/arm64"
92+
9193
for image in "${IMAGES[@]}"; do
9294
image_dir="$PROJECT_ROOT/images/$image"
9395
image_file="${TAG}.Dockerfile"
@@ -102,7 +104,13 @@ for image in "${IMAGES[@]}"; do
102104
continue
103105
fi
104106

105-
run_trace $DRY_RUN depot build --project "gb3p8xrshk" --load --platform linux/amd64,linux/arm64 --save --metadata-file="build_${image}.json" \
107+
# Allow per-image platform override via a .platforms file.
108+
platform="$DEFAULT_PLATFORM"
109+
if [ -f "$image_dir/.platforms" ]; then
110+
platform=$(cat "$image_dir/.platforms")
111+
fi
112+
113+
run_trace $DRY_RUN depot build --project "gb3p8xrshk" --load --platform "$platform" --save --metadata-file="build_${image}.json" \
106114
"${docker_flags[@]}" \
107115
"$image_dir" \
108116
--file="$image_path" \

scripts/images.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ IMAGES=(
1010
"java"
1111
"node"
1212
"desktop"
13+
"universal"
1314
)

0 commit comments

Comments
 (0)