ci: add buildx

This commit is contained in:
ngxson
2023-05-19 14:01:07 +02:00
parent 3397bf5993
commit 6bf4c92378
2 changed files with 6 additions and 3 deletions

View File

@@ -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

View File

@@ -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"
@@ -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"