From a0e70e161cae9c7ecbe75980e0743dc28a2805ac Mon Sep 17 00:00:00 2001 From: Mathias Gebbe Date: Sun, 16 Jun 2024 23:51:51 +0200 Subject: [PATCH] chore: multiarch docker images --- .github/workflows/release.yml | 14 ++++++++++++++ .goreleaser.yml | 20 -------------------- Dockerfile-goreleaser | 4 ---- 3 files changed, 14 insertions(+), 24 deletions(-) delete mode 100644 Dockerfile-goreleaser diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00e1d5c..96f9c18 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Docker Login uses: docker/login-action@v3.2.0 with: @@ -31,3 +37,11 @@ jobs: args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }} diff --git a/.goreleaser.yml b/.goreleaser.yml index ee2f853..6ebe95f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -29,23 +29,3 @@ archives: files: - none* -release: - draft: false - prerelease: false - -dockers: - - id: linux-amd64 - goos: linux - goarch: amd64 - dockerfile: Dockerfile-goreleaser - build_flag_templates: - - "--pull" - - "--label=org.opencontainers.image.created={{ .Date }}" - - "--label=org.opencontainers.image.name={{ .ProjectName }}" - - "--label=org.opencontainers.image.revision={{ .FullCommit }}" - - "--label=org.opencontainers.image.version={{ .Version }}" - - "--label=org.opencontainers.image.source={{ .GitURL }}" - - "--platform=linux/amd64" - image_templates: - - "ghcr.io/matzegebbe/web-jwks-validator:v{{ .Version }}" - diff --git a/Dockerfile-goreleaser b/Dockerfile-goreleaser deleted file mode 100644 index 793b86d..0000000 --- a/Dockerfile-goreleaser +++ /dev/null @@ -1,4 +0,0 @@ -FROM alpine:3.20.0 -COPY web-jwks-validator / -RUN apk --no-cache add ca-certificates -ENTRYPOINT ["/web-jwks-validator"] \ No newline at end of file