Skip to content

Commit

Permalink
Add hooks for multi-arch builds on dockerhub (#1683)
Browse files Browse the repository at this point in the history
- hooks/build overrides the default build command to use buildx and
  create an image for amd64 and arm64 archictectures. The arm64 build
  will take time to build as it is emulated using qemu.
- hooks/push overrides the default push command to push the multi-arch
  images. The push is initiated from the buildx context since we have
  the push argument(--push) set in the buildx command.
  • Loading branch information
MuhammadTahaNaveed authored Mar 15, 2024
1 parent 1e7c7f5 commit 041adb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker/hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

docker buildx create --name multiarch --use --platform linux/amd64,linux/arm64/v8
docker buildx build ../ -t $IMAGE_NAME -f Dockerfile --platform linux/amd64,linux/arm64/v8 --push
1 change: 1 addition & 0 deletions docker/hooks/push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/bin/bash

0 comments on commit 041adb2

Please sign in to comment.