Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
COSI-29: Updated Dockerfile to support multi-arch
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Oct 29, 2024
1 parent 2e4eb8a commit b17c167
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
FROM golang:1.23.2 AS builder
ARG TARGETOS
ARG TARGETARCH

WORKDIR /app

ENV CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64

COPY go.mod go.sum ./
RUN go mod download

COPY . .

RUN go build -o scality-cosi-driver ./cmd/scality-cosi-driver
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -o scality-cosi-driver ./cmd/scality-cosi-driver

FROM gcr.io/distroless/static:latest
COPY --from=builder /app/scality-cosi-driver /scality-cosi-driver
Expand Down

0 comments on commit b17c167

Please sign in to comment.