Skip to content

Commit 8cb4718

Browse files
committed
update at 2024-07-15 15:15:10
1 parent 1c50e9d commit 8cb4718

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Dockerfile

+4-6
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,20 @@ COPY go.sum go.sum
1212
RUN go mod download
1313

1414
# Copy the go source
15-
COPY cmd/main.go cmd/main.go
16-
COPY api/ api/
17-
COPY internal/controller/ internal/controller/
15+
COPY . .
1816

1917
# Build
2018
# the GOARCH has not a default value to allow the binary be built according to the host where the command
2119
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
2220
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
2321
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
24-
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
22+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go build -a -o tke-extend-network-controller cmd/main.go
2523

2624
# Use distroless as minimal base image to package the manager binary
2725
# Refer to https://github.com/GoogleContainerTools/distroless for more details
2826
FROM gcr.io/distroless/static:nonroot
2927
WORKDIR /
30-
COPY --from=builder /workspace/manager .
28+
COPY --from=builder /workspace/tke-extend-network-controller .
3129
USER 65532:65532
3230

33-
ENTRYPOINT ["/manager"]
31+
ENTRYPOINT ["/tke-extend-network-controller"]

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Image URL to use all building/pushing image targets
2-
IMG ?= controller:latest
2+
IMG ?= imroc/tke-extend-network-controller:latest
33
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
44
ENVTEST_K8S_VERSION = 1.30.0
55

@@ -97,6 +97,9 @@ docker-build: ## Build docker image with the manager.
9797
docker-push: ## Push docker image with the manager.
9898
$(CONTAINER_TOOL) push ${IMG}
9999

100+
.PHONY: docker-build-push
101+
docker-build-push: docker-build docker-push
102+
100103
# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
101104
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
102105
# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/

0 commit comments

Comments
 (0)