Skip to content

Commit 62222f2

Browse files
chore(dev): add multi arch support to devcontainer image
1 parent d50d351 commit 62222f2

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

.github/workflows/build-devcontainer-image.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,22 @@ jobs:
4242
4343
- name: "Build and push image"
4444
run: |
45-
devpod build . --devcontainer-path .github/devcontainer/devcontainer.json --platform linux/amd64,linux/arm64 --skip-push
46-
ID=$(docker images --format "{{.ID}} {{.CreatedAt}} {{.Tag}}" | sort -rk 2 | grep "devpod" | awk 'NR==1{print $1}')
47-
echo "found image: $ID"
48-
if [ -z "${ID}" ]; then
49-
echo "Image ID empty, exiting"
50-
exit 0
51-
fi
52-
# Change tag to `dev`
53-
docker image ls
54-
docker tag $ID ghcr.io/loft-sh/devpod:dev
55-
docker push ghcr.io/loft-sh/devpod:dev
45+
for ARCH in amd64 arm64; do
46+
# Build for $ARCH
47+
devpod build . --devcontainer-path .github/devcontainer/devcontainer.json --platform linux/$ARCH --skip-push
48+
ID=$(docker images --format "{{.ID}} {{.CreatedAt}} {{.Tag}}" | sort -rk 2 | grep "devpod" | awk 'NR==1{print $1}')
49+
echo "found image: $ID"
50+
if [ -z "${ID}" ]; then
51+
echo "Image ID empty, exiting"
52+
exit 0
53+
fi
54+
docker image ls
55+
docker tag $ID ghcr.io/loft-sh/devpod:dev-$ARCH
56+
done
57+
58+
# Combine into multi-arch image
59+
docker manifest create ghcr.io/loft-sh/devpod:dev \
60+
--amend ghcr.io/loft-sh/devpod:dev-amd64 \
61+
--amend ghcr.io/loft-sh/devpod:dev-arm64
62+
63+
docker manifest push ghcr.io/loft-sh/devpod:dev

0 commit comments

Comments
 (0)