Skip to content

Commit

Permalink
add arm64 arch for docker build (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
elopsod authored May 27, 2024
1 parent 9a6ebad commit f8eb43e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,19 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ env.TAG }}
tags: |
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM golang:alpine AS builder
FROM --platform=$BUILDPLATFORM golang:alpine AS builder
ARG VERSION
ARG TARGETARCH

RUN apk update && apk add --no-cache git

Expand All @@ -11,7 +12,7 @@ ADD . .

RUN go mod download
RUN go get -d -v
RUN CGO_ENABLED=0 GOOS=linux go build \
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build \
-ldflags="-X 'github.com/jonasvinther/medusa/cmd.Version=${VERSION}'" \
-o /go/bin/medusa

Expand Down

0 comments on commit f8eb43e

Please sign in to comment.