Skip to content

Commit

Permalink
Add support for multiarch container images (amd64/arm64)
Browse files Browse the repository at this point in the history
Container images built with support for the ARM architecture
perform much better on Apple Silicon laptops.
  • Loading branch information
ihalaij1 authored and markkuriekkinen committed Jun 25, 2023
1 parent 7647bff commit 7f5f2dd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM apluslms/service-base:django-1.17
FROM --platform=$TARGETPLATFORM apluslms/service-base:django-1.18

# Set container related configuration via environment variables
ENV CONTAINER_TYPE="radar" \
Expand Down
11 changes: 11 additions & 0 deletions docker/hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

docker run --privileged --rm tonistiigi/binfmt --install all

docker buildx create --use default

docker buildx build \
--push \
--tag "$DOCKER_REPO":"$DOCKER_TAG" \
--platform linux/amd64,linux/arm64 \
--file Dockerfile ..
3 changes: 3 additions & 0 deletions docker/hooks/push
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

# This hook is empty because the image was pushed to the registry in the build hook

0 comments on commit 7f5f2dd

Please sign in to comment.