From 9f460f529477cfd8edfd952b86e24fb310d7c633 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Sun, 11 Feb 2024 12:15:35 +0800 Subject: [PATCH 1/2] github actions build arm64 docker image [#136] --- .github/workflows/publish.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 251c3b1..de229d6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,6 +20,8 @@ jobs: id: meta with: images: ghcr.io/${{ github.repository }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - uses: docker/login-action@v3 with: registry: ghcr.io @@ -28,7 +30,7 @@ jobs: - uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64 + platforms: linux/amd64, linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -41,6 +43,8 @@ jobs: id: meta with: images: protomaps/go-pmtiles + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - uses: docker/login-action@v3 with: username: protomaps @@ -48,7 +52,7 @@ jobs: - uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64 + platforms: linux/amd64, linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From e16419c83ea411b02c4bd917f559c75d53a24bff Mon Sep 17 00:00:00 2001 From: jonasengelmann <40031476+jonasengelmann@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:31:41 +0100 Subject: [PATCH 2/2] Docker multi platform support (#139) * add docker multiplatform support --- .github/workflows/publish.yml | 49 ++++++++++++++--------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index de229d6..9e3bece 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,48 +12,39 @@ on: - 'main' jobs: - docker-build-ghcr: + docker-build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: docker/metadata-action@v5 - id: meta - with: - images: ghcr.io/${{ github.repository }} + - name: Checkout + uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64, linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=See https://github.com/protomaps/go-pmtiles for more info. - docker-build-dockerhub: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - uses: docker/metadata-action@v5 id: meta with: - images: protomaps/go-pmtiles - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - uses: docker/login-action@v3 + images: | + protomaps/go-pmtiles + ghcr.io/${{ github.repository }} + - name: Login to Docker Hub + uses: docker/login-action@v3 with: username: protomaps password: ${{ secrets.DOCKER_PASSWORD }} - - uses: docker/build-push-action@v5 + - name: Login to Github Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64, linux/arm64 + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} + provenance: false tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=See https://github.com/protomaps/go-pmtiles for more info.