Skip to content

Commit

Permalink
ci: add buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxson committed May 19, 2023
1 parent 3397bf5 commit 6bf4c92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
- name: Setup QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- run: sudo apt update && sudo apt install -y qemu-user-static

- name: Setup Node.js
Expand Down
6 changes: 3 additions & 3 deletions scripts/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Also build one for :latest

IMAGE="ngxson/portainer-ce-without-annoying"
ARCHS="linux/amd64,linux/arm64,linux/arm/v7"

if [ -z "$TAG" ]; then
echo "Please set TAG environment variable"
Expand All @@ -17,9 +18,8 @@ if [ -z "$MULTIARCH" ]; then
docker build -t "$IMAGE:$TAG" -f Dockerfile.tmp .
else
echo "Multi-arch build..."
docker build --platform linux/amd64 -t "$IMAGE:$TAG" -f Dockerfile.tmp .
docker build --platform linux/arm64 -t "$IMAGE:$TAG" -f Dockerfile.tmp .
docker build --platform linux/arm/v7 -t "$IMAGE:$TAG" -f Dockerfile.tmp .
docker buildx create --use desktop-linux
docker buildx build --platform=$ARCHS -t "$IMAGE:$TAG" -f Dockerfile.tmp .
fi

docker push "$IMAGE:$TAG"

0 comments on commit 6bf4c92

Please sign in to comment.