Skip to content

Commit 041adb2

Browse files
Add hooks for multi-arch builds on dockerhub (#1683)
- 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.
1 parent 1e7c7f5 commit 041adb2

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

docker/hooks/build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
docker buildx create --name multiarch --use --platform linux/amd64,linux/arm64/v8
4+
docker buildx build ../ -t $IMAGE_NAME -f Dockerfile --platform linux/amd64,linux/arm64/v8 --push

docker/hooks/push

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/bin/bash

0 commit comments

Comments
 (0)