Skip to content

Commit 385996e

Browse files
committed
docker build push success
1 parent 90b98ae commit 385996e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ ARG TARGETOS
44
ARG TARGETARCH
55

66
WORKDIR /workspace
7+
ENV GO111MODULE=on \
8+
GOPROXY=https://goproxy.cn,direct
79
# Copy the Go Modules manifests
810
COPY go.mod go.mod
911
COPY go.sum go.sum
@@ -25,7 +27,8 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o ma
2527

2628
# Use distroless as minimal base image to package the manager binary
2729
# Refer to https://github.com/GoogleContainerTools/distroless for more details
28-
FROM gcr.io/distroless/static:nonroot
30+
# FROM gcr.io/distroless/static:nonroot
31+
FROM gcr.lank8s.cn/distroless/static:nonroot
2932
WORKDIR /
3033
COPY --from=builder /workspace/manager .
3134
USER 65532:65532

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
127127
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
128128
.PHONY: docker-build
129129
docker-build: test ## Build docker image with the manager.
130-
docker build -t ${IMG} .
130+
docker build --network=host -t ${IMG} .
131131

132132
.PHONY: docker-push
133133
docker-push: ## Push docker image with the manager.

0 commit comments

Comments
 (0)