diff --git a/.github/workflows/ci-docker-build.yml b/.github/workflows/ci-docker-build.yml index 8c8a348c461..5e0845ec3a9 100644 --- a/.github/workflows/ci-docker-build.yml +++ b/.github/workflows/ci-docker-build.yml @@ -44,7 +44,16 @@ jobs: - uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 + - name: Build only linux/amd64 docker image for Pull Request + if: github.ref_name != 'main' + run: bash scripts/build-upload-docker-images.sh + env: + PLATFORMS: "linux/amd64" + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} + - name: Build and upload all docker images + if: github.ref_name == 'main' run: bash scripts/build-upload-docker-images.sh env: DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/scripts/build-upload-docker-images.sh b/scripts/build-upload-docker-images.sh index 14ad299821c..6e467781684 100755 --- a/scripts/build-upload-docker-images.sh +++ b/scripts/build-upload-docker-images.sh @@ -2,16 +2,19 @@ set -euxf -o pipefail +# build multi-arch docker images by default +platforms="${PLATFORMS:-linux/amd64,linux/s390x,linux/ppc64le,linux/arm64}" + make create-baseimg-debugimg -# build multi-arch binaries make build-binaries-linux -make build-binaries-s390x -make build-binaries-ppc64le -make build-binaries-arm64 -# build multi-arch docker images -platforms="linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" +# build multi-arch binaries +if [ "$platforms" = "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" ]; then + make build-binaries-s390x + make build-binaries-ppc64le + make build-binaries-arm64 +fi # build/upload raw and debug images of Jaeger backend components for component in agent collector query ingester remote-storage