Skip to content

Commit

Permalink
Merge pull request #40 from danquack/danquack-patch-1
Browse files Browse the repository at this point in the history
Add arm support
  • Loading branch information
joeirimpan authored Dec 12, 2023
2 parents 18c19ea + af46262 commit 443868d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.prep.outputs.tags }}
labels: |
Expand All @@ -85,4 +85,4 @@ jobs:
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ fromJson(steps.repo.outputs.result).license.spdx_id }}
org.opencontainers.image.licenses=${{ fromJson(steps.repo.outputs.result).license.spdx_id }}
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Use an official Golang runtime as the base image
FROM golang:1.18 as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.18 as builder

ARG TARGETOS
ARG TARGETARCH
ARG TARGETPLATFORM
ARG BUILDPLATFORM

# Set the working directory in the container
WORKDIR /app
Expand All @@ -8,10 +13,10 @@ WORKDIR /app
COPY . .

# Build the application
RUN make build
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build

# Use a lightweight Alpine image as the base image for the final container
FROM alpine:latest
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:latest

# Set the working directory in the container
WORKDIR /app
Expand Down

0 comments on commit 443868d

Please sign in to comment.