From 0ab00b2b00e7fc057b6bc9a5fb6fc25d84ee14bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Wed, 24 Apr 2024 16:00:48 +0200 Subject: [PATCH] chore(build): use build-platform instead of emulation --- .dockerignore | 9 ++++++++- .github/workflows/__build-workflow.yaml | 7 +------ Dockerfile | 2 +- debug.Dockerfile | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.dockerignore b/.dockerignore index 0f046820f..ce5db4b88 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,11 @@ # More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file # Ignore build and test binaries. bin/ -testbin/ +config/ +docs/ +scripts/ +logo/ +*Dockerfile +Dockerfile* +test/ +*.md diff --git a/.github/workflows/__build-workflow.yaml b/.github/workflows/__build-workflow.yaml index 547308387..83becff2d 100644 --- a/.github/workflows/__build-workflow.yaml +++ b/.github/workflows/__build-workflow.yaml @@ -159,11 +159,6 @@ jobs: username: ${{ inputs.username }} password: ${{ secrets.dockerhub-token }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: ${{ matrix.arch }} - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -197,7 +192,7 @@ jobs: type=semver,pattern={{major}} type=sha ${{ env.TAGS_STANDARD }}${{ env.TAGS_SUPPLEMENTAL }} - flavor: latest=${{ inputs.latest }},suffix=-${{ matrix.arch }} + flavor: latest=${{ inputs.latest }},suffix=-${{ matrix.arch }} - uses: docker/setup-buildx-action@v3 diff --git a/Dockerfile b/Dockerfile index be8ee0a65..6c78fcb53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # Builder # ------------------------------------------------------------------------------ -FROM golang:1.22.2 as builder +FROM --platform=$BUILDPLATFORM golang:1.22.2 as builder WORKDIR /workspace ARG GOPATH diff --git a/debug.Dockerfile b/debug.Dockerfile index 50a7353a3..dd6512d92 100644 --- a/debug.Dockerfile +++ b/debug.Dockerfile @@ -2,7 +2,7 @@ # Debug image # ------------------------------------------------------------------------------ -FROM golang:1.22.2 as debug +FROM --platform=$BUILDPLATFORM golang:1.22.2 as debug ARG GOPATH ARG GOCACHE