Skip to content

Commit 242b7ed

Browse files
ihalaij1markkuriekkinen
authored andcommitted
Add support for multiarch container images (amd64/arm64)
Container images built with support for the ARM architecture perform much better on Apple Silicon laptops.
1 parent 29b31ae commit 242b7ed

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye-20221114-slim
1+
FROM --platform=$TARGETPLATFORM debian:bullseye-20221114-slim
22

33
ENV LANG=C.UTF-8 USER=root HOME=/root
44

hooks/build

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
docker run --privileged --rm tonistiigi/binfmt --install all
4+
5+
docker buildx create --use default
6+
7+
docker buildx build \
8+
--push \
9+
--tag "$DOCKER_REPO":"$DOCKER_TAG" \
10+
--platform linux/amd64,linux/arm64 .

hooks/push

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
# This hook is empty because the image was pushed to the registry in the build hook

0 commit comments

Comments
 (0)