diff --git a/Dockerfile b/Dockerfile index 75d5a934ef..6e494e55b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,8 +27,8 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ go build ./cmd/cloud-controller-manager RUN --mount=type=cache,target=/root/.cache/go-build \ - make bin/azure-cloud-controller-manager ENABLE_GIT_COMMAND=${ENABLE_GIT_COMMAND} ARCH=${ARCH} + make bin/azure-cloud-controller-manager ENABLE_GIT_COMMAND=${ENABLE_GIT_COMMAND} ARCH=${ARCH} -FROM gcr.io/distroless/static +FROM gcr.io/distroless/base COPY --from=builder /go/src/sigs.k8s.io/cloud-provider-azure/bin/azure-cloud-controller-manager /usr/local/bin/cloud-controller-manager ENTRYPOINT [ "/usr/local/bin/cloud-controller-manager" ] diff --git a/Makefile b/Makefile index 61262d2ab9..1b071f6417 100644 --- a/Makefile +++ b/Makefile @@ -104,19 +104,19 @@ help: ## Display this help. all: $(BIN_DIR)/azure-cloud-controller-manager $(BIN_DIR)/azure-cloud-node-manager $(BIN_DIR)/azure-cloud-node-manager.exe ## Build binaries for the project. $(BIN_DIR)/azure-cloud-node-manager: $(PKG_CONFIG) $(wildcard cmd/cloud-node-manager/*) $(wildcard cmd/cloud-node-manager/**/*) $(wildcard pkg/**/*) ## Build node-manager binary for Linux. - CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-cloud-node-manager $(shell cat $(PKG_CONFIG)) ./cmd/cloud-node-manager + CGO_ENABLED=1 GOOS=linux GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-cloud-node-manager $(shell cat $(PKG_CONFIG)) ./cmd/cloud-node-manager $(BIN_DIR)/azure-cloud-node-manager.exe: $(PKG_CONFIG) $(wildcard cmd/cloud-node-manager/*) $(wildcard cmd/cloud-node-manager/**/*) $(wildcard pkg/**/*) ## Build node-manager binary for Windows. - CGO_ENABLED=0 GOOS=windows GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-cloud-node-manager-${ARCH}.exe $(shell cat $(PKG_CONFIG)) ./cmd/cloud-node-manager + CGO_ENABLED=1 GOOS=windows GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-cloud-node-manager-${ARCH}.exe $(shell cat $(PKG_CONFIG)) ./cmd/cloud-node-manager $(BIN_DIR)/azure-cloud-controller-manager: $(PKG_CONFIG) $(wildcard cmd/cloud-controller-manager/*) $(wildcard cmd/cloud-controller-manager/**/*) $(wildcard pkg/**/*) ## Build binary for controller-manager. - CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-cloud-controller-manager $(shell cat $(PKG_CONFIG)) ./cmd/cloud-controller-manager + CGO_ENABLED=1 GOOS=linux GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-cloud-controller-manager $(shell cat $(PKG_CONFIG)) ./cmd/cloud-controller-manager $(BIN_DIR)/azure-acr-credential-provider: $(PKG_CONFIG) $(wildcard cmd/acr-credential-provider/*) $(wildcard cmd/acr-credential-provider/**/*) $(wildcard pkg/**/*) ## Build binary for acr-credential-provider. - CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-acr-credential-provider $(shell cat $(PKG_CONFIG)) ./cmd/acr-credential-provider + CGO_ENABLED=1 GOOS=linux GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-acr-credential-provider $(shell cat $(PKG_CONFIG)) ./cmd/acr-credential-provider $(BIN_DIR)/azure-acr-credential-provider.exe: $(PKG_CONFIG) $(wildcard cmd/acr-credential-provider/*) $(wildcard cmd/acr-credential-provider/**/*) $(wildcard pkg/**/*) ## Build binary for acr-credential-provider. - CGO_ENABLED=0 GOOS=windows GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-acr-credential-provider.exe $(shell cat $(PKG_CONFIG)) ./cmd/acr-credential-provider + CGO_ENABLED=1 GOOS=windows GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-acr-credential-provider.exe $(shell cat $(PKG_CONFIG)) ./cmd/acr-credential-provider ## -------------------------------------- ##@ Images diff --git a/cloud-node-manager.Dockerfile b/cloud-node-manager.Dockerfile index dbc6745fc0..c4441d61cb 100644 --- a/cloud-node-manager.Dockerfile +++ b/cloud-node-manager.Dockerfile @@ -25,9 +25,9 @@ COPY . . # Build the Go app RUN make bin/azure-cloud-node-manager ENABLE_GIT_COMMAND=${ENABLE_GIT_COMMAND} -# Use distroless static image for a lean production container. +# Use distroless base image for a lean production container. # Start a new build stage. -FROM gcr.io/distroless/static +FROM gcr.io/distroless/base # Create a group and user USER 65532:65532 diff --git a/health-probe-proxy/Dockerfile b/health-probe-proxy/Dockerfile index c613885f83..ee51f7e778 100644 --- a/health-probe-proxy/Dockerfile +++ b/health-probe-proxy/Dockerfile @@ -14,6 +14,6 @@ # syntax=docker/dockerfile:1 -FROM gcr.io/distroless/static@sha256:ce46866b3a5170db3b49364900fb3168dc0833dfb46c26da5c77f22abb01d8c3 +FROM gcr.io/distroless/base COPY bin/health-probe-proxy /usr/local/bin/health-probe-proxy ENTRYPOINT [ "/usr/local/bin/health-probe-proxy" ]