Skip to content

Commit

Permalink
feat: add arm64 support for docker image (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamtagscherer authored Jun 7, 2023
1 parent ec80c8f commit c301813
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/reusable-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
tags: ghcr.io/openclarity/grype-server:${{ inputs.image_tag }}
file: Dockerfile
push: ${{ inputs.push }}
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.4-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.20.4-alpine AS builder

RUN apk add --update --no-cache gcc g++

Expand All @@ -11,7 +11,11 @@ RUN go mod download

# Copy and build backend code
COPY grype-server .
RUN go build -o grype-server ./cmd/grype-server/main.go

ARG TARGETOS
ARG TARGETARCH

RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o grype-server ./cmd/grype-server/main.go

FROM alpine:3.17

Expand Down

0 comments on commit c301813

Please sign in to comment.