diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e53263c3e21..1c94d31f2a46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -150,6 +150,9 @@ jobs: -t $DOCKER_IMAGE_ID . - name: Check run: | + docker buildx build --load \ + --platform linux/amd64,linux/arm64 \ + -t $DOCKER_IMAGE_ID . docker run $DOCKER_IMAGE_ID version docker run $DOCKER_IMAGE_ID --help docker run $DOCKER_IMAGE_ID help @@ -170,20 +173,23 @@ jobs: if: ${{ github.ref == 'refs/heads/master' }} run: | echo "Publish as ghcr.io/$GHCR_IMAGE_ID:$VERSION" - docker tag "$DOCKER_IMAGE_ID" "ghcr.io/$GHCR_IMAGE_ID:master" - docker push "ghcr.io/$GHCR_IMAGE_ID:master" + docker buildx build --push \ + --platform linux/amd64,linux/arm64 \ + -t ghcr.io/$GHCR_IMAGE_ID:master . - name: Publish tagged version image to ghcr.io if: ${{ startsWith(github.ref, 'refs/tags/v') }} run: | VERSION="${VERSION#v}" echo "Publish as ghcr.io/$GHCR_IMAGE_ID:$VERSION" - docker tag "$DOCKER_IMAGE_ID" "ghcr.io/$GHCR_IMAGE_ID:$VERSION" - docker push "ghcr.io/$GHCR_IMAGE_ID:$VERSION" + docker buildx build --push \ + --platform linux/amd64,linux/arm64 \ + -t ghcr.io/$GHCR_IMAGE_ID:$VERSION . # We also want to tag the latest stable version as latest if [[ ! "$VERSION" =~ (RC|rc) ]]; then echo "Publish as ghcr.io/$GHCR_IMAGE_ID:latest" - docker tag "$DOCKER_IMAGE_ID" "ghcr.io/$GHCR_IMAGE_ID:latest" - docker push "ghcr.io/$GHCR_IMAGE_ID:latest" + docker buildx build --push \ + --platform linux/amd64,linux/arm64 \ + -t ghcr.io/$GHCR_IMAGE_ID:latest . fi - name: Log into Docker Hub @@ -195,27 +201,33 @@ jobs: if: ${{ github.ref == 'refs/heads/master' }} run: | echo "Publish to Docker Hub as $DOCKER_IMAGE_ID:master and $LI_DOCKER_IMAGE_ID:master" - docker tag "$DOCKER_IMAGE_ID" "$DOCKER_IMAGE_ID:master" - docker tag "$DOCKER_IMAGE_ID" "$LI_DOCKER_IMAGE_ID:master" - docker push "$DOCKER_IMAGE_ID:master" - docker push "$LI_DOCKER_IMAGE_ID:master" + docker buildx build --push \ + --platform linux/amd64,linux/arm64 \ + -t ghcr.io/$DOCKER_IMAGE_ID:master . + docker buildx build --push \ + --platform linux/amd64,linux/arm64 \ + -t ghcr.io/$LI_DOCKER_IMAGE_ID:master . - name: Publish tagged version image to Docker Hub if: ${{ startsWith(github.ref, 'refs/tags/v') }} run: | # We need to push the same image in both the loadimpact and the grafana docker hub orgs VERSION="${VERSION#v}" echo "Publish to Docker Hub as $DOCKER_IMAGE_ID:$VERSION and $LI_DOCKER_IMAGE_ID:$VERSION" - docker tag "$DOCKER_IMAGE_ID" "$DOCKER_IMAGE_ID:$VERSION" - docker tag "$DOCKER_IMAGE_ID" "$LI_DOCKER_IMAGE_ID:$VERSION" - docker push "$DOCKER_IMAGE_ID:$VERSION" - docker push "$LI_DOCKER_IMAGE_ID:$VERSION" + docker buildx build --push \ + --platform linux/amd64,linux/arm64 \ + -t ghcr.io/$DOCKER_IMAGE_ID:$VERSION . + docker buildx build --push \ + --platform linux/amd64,linux/arm64 \ + -t ghcr.io/$LI_DOCKER_IMAGE_ID:$VERSION . # We also want to tag the latest stable version as latest if [[ ! "$VERSION" =~ (RC|rc) ]]; then echo "Publish to Docker Hub as $DOCKER_IMAGE_ID:latest and $LI_DOCKER_IMAGE_ID:latest" - docker tag "$DOCKER_IMAGE_ID" "$DOCKER_IMAGE_ID:latest" - docker tag "$DOCKER_IMAGE_ID" "$LI_DOCKER_IMAGE_ID:latest" - docker push "$DOCKER_IMAGE_ID:latest" - docker push "$LI_DOCKER_IMAGE_ID:latest" + docker buildx build --push \ + --platform linux/amd64,linux/arm64 \ + -t ghcr.io/$DOCKER_IMAGE_ID:latest . + docker buildx build --push \ + --platform linux/amd64,linux/arm64 \ + -t ghcr.io/$LI_DOCKER_IMAGE_ID:latest . fi package-windows: