Skip to content

Commit

Permalink
chore(build): use build-platform instead of emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Apr 24, 2024
1 parent 84ad6fb commit 0ab00b2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
9 changes: 8 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -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
7 changes: 1 addition & 6 deletions .github/workflows/__build-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion debug.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ab00b2

Please sign in to comment.