Skip to content

Commit

Permalink
Revert the Dockerfile multi architecture support (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardChen820 authored Apr 25, 2024
1 parent 1db914e commit c86a99a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/oss/go/microsoft/golang:1.22-cbl-mariner2.0 as builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22-cbl-mariner2.0 as builder

ARG MODULE_VERSION
WORKDIR /workspace
Expand All @@ -16,14 +16,12 @@ COPY api/ api/
COPY internal/controller/ internal/controller/
COPY internal/loader/ internal/loader/
COPY internal/properties/ internal/properties/

ARG TARGETARCH


# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -ldflags "-X azappconfig/provider/internal/properties.ModuleVersion=$MODULE_VERSION" -a -o manager cmd/main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X azappconfig/provider/internal/properties.ModuleVersion=$MODULE_VERSION" -a -o manager cmd/main.go

# Use distroless as minimal base image to package the manager binary
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/cbl-mariner/distroless/minimal:2.0-nonroot
FROM mcr.microsoft.com/cbl-mariner/distroless/minimal:2.0-nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
USER 65532:65532
Expand Down

0 comments on commit c86a99a

Please sign in to comment.