Skip to content

Commit 9564887

Browse files
chore: use base distroless images from MCR (#1166)
2 parents 194e8c0 + 635d37d commit 9564887

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

docker/crd-installer.Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ COPY cmd/crdinstaller/ cmd/crdinstaller/
1414

1515
ARG TARGETARCH
1616

17-
# Build
18-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on go build -o crdinstaller cmd/crdinstaller/main.go
17+
# Build with CGO enabled and GOEXPERIMENT=systemcrypto for internal usage
18+
RUN CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH} GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o crdinstaller cmd/crdinstaller/main.go
1919

20-
# Use distroless as minimal base image to package the crdinstaller binary
21-
FROM gcr.io/distroless/static:nonroot
20+
# Use Azure Linux distroless base image to package the crdinstaller binary
21+
# Refer to https://mcr.microsoft.com/en-us/artifact/mar/azurelinux/distroless/base/about for more details
22+
FROM mcr.microsoft.com/azurelinux/distroless/base:3.0
2223
WORKDIR /
2324
COPY --from=builder /workspace/crdinstaller .
2425
COPY config/crd/bases/ /workspace/config/crd/bases/

docker/hub-agent.Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ COPY pkg/ pkg/
1616

1717
ARG TARGETARCH
1818

19-
# Build
20-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on go build -o hubagent cmd/hubagent/main.go
19+
# Build with CGO enabled and GOEXPERIMENT=systemcrypto for internal usage
20+
RUN CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH} GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o hubagent cmd/hubagent/main.go
2121

22-
# Use distroless as minimal base image to package the hubagent binary
23-
# Refer to https://github.com/GoogleContainerTools/distroless for more details
24-
FROM gcr.io/distroless/static:nonroot
22+
# Use Azure Linux distroless base image to package the hubagent binary
23+
# Refer to https://mcr.microsoft.com/en-us/artifact/mar/azurelinux/distroless/base/about for more details
24+
FROM mcr.microsoft.com/azurelinux/distroless/base:3.0
2525
WORKDIR /
2626
COPY --from=builder /workspace/hubagent .
2727
USER 65532:65532

docker/member-agent.Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ COPY pkg/ pkg/
1616

1717
ARG TARGETARCH
1818

19-
# Build
20-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on go build -o memberagent main.go
19+
# Build with CGO enabled and GOEXPERIMENT=systemcrypto for internal usage
20+
RUN CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH} GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o memberagent main.go
2121

22-
# Use distroless as minimal base image to package the memberagent binary
23-
# Refer to https://github.com/GoogleContainerTools/distroless for more details
24-
FROM gcr.io/distroless/static:nonroot
22+
# Use Azure Linux distroless base image to package the memberagent binary
23+
# Refer to https://mcr.microsoft.com/en-us/artifact/mar/azurelinux/distroless/base/about for more details
24+
FROM mcr.microsoft.com/azurelinux/distroless/base:3.0
2525
WORKDIR /
2626
COPY --from=builder /workspace/memberagent .
2727
USER 65532:65532

docker/refresh-token.Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Build the hubagent binary
1+
# Build the refreshtoken binary
22
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.24.4 AS builder
33

44
WORKDIR /workspace
@@ -15,12 +15,12 @@ COPY pkg/authtoken pkg/authtoken
1515

1616
ARG TARGETARCH
1717

18-
# Build
19-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on go build -o refreshtoken main.go
18+
# Build with CGO enabled and GOEXPERIMENT=systemcrypto for internal usage
19+
RUN CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH} GOEXPERIMENT=systemcrypto GO111MODULE=on go build -o refreshtoken main.go
2020

21-
# Use distroless as minimal base image to package the refreshtoken binary
22-
# Refer to https://github.com/GoogleContainerTools/distroless for more details
23-
FROM gcr.io/distroless/static:nonroot
21+
# Use Azure Linux distroless base image to package the refreshtoken binary
22+
# Refer to https://mcr.microsoft.com/en-us/artifact/mar/azurelinux/distroless/base/about for more details
23+
FROM mcr.microsoft.com/azurelinux/distroless/base:3.0
2424
WORKDIR /
2525
COPY --from=builder /workspace/refreshtoken .
2626
USER 65532:65532

0 commit comments

Comments
 (0)