Skip to content

Commit 40ebb8f

Browse files
committed
fix: add custom script for build multi-arch and push : #32
1 parent c2be93f commit 40ebb8f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

script/img_push_multi_arch.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# This is a script to push with multiple platform images to docker hub
4+
5+
# login to docker hub
6+
BM_USER="ghkdqhrbals"
7+
BM_PLATFORM="linux/amd64,linux/arm64"
8+
BM_VERSION="latest"
9+
10+
docker buildx create --use
11+
12+
docker buildx inspect --bootstrap
13+
14+
echo "Build the docker image with multi platform support"
15+
docker buildx build --platform ${BM_PLATFORM} -t ${BM_USER}/bm-controller:${BM_VERSION} -f /bm-controller/Dockerfile --push .
16+
docker buildx build --platform ${BM_PLATFORM} -t ${BM_USER}/bm-agent:${BM_VERSION} -f /bm-agent/Dockerfile --push .
17+
18+
# Build the docker image
19+
images=$(docker images --format "{{.Repository}}" | grep "^${PREFIX}")
20+
21+
# Push the docker image to docker hub
22+
echo "Image deploy to docker hub"
23+
for image in $images; do
24+
echo "${image}"
25+
docker push "${image}"
26+
done

0 commit comments

Comments
 (0)