You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by zh...@apache.org on 2025/06/20 00:49:58 UTC

(dubbo-kubernetes) branch master updated: [chore] add dubbo-cp image (#733)

This is an automated email from the ASF dual-hosted git repository.

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new 96ffe3fc [chore] add dubbo-cp image (#733)
96ffe3fc is described below

commit 96ffe3fca2bf176ddbd4f7ff1395f433451278a4
Author: Jian Zhong <11...@qq.com>
AuthorDate: Fri Jun 20 08:49:54 2025 +0800

    [chore] add dubbo-cp image (#733)
---
 Dockerfile | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..18c13013
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,26 @@
+# Build the manager binary
+FROM docker.io/golang:1.23 AS builder
+ARG TARGETOS
+ARG TARGETARCH
+
+WORKDIR /app
+
+COPY go.mod go.mod
+COPY go.sum go.sum
+
+ENV GOPROXY=https://goproxy.cn,direct
+
+# cache deps before building and copying source so that we don't need to re-download as much
+# and so that source changes don't invalidate our downloaded layer
+RUN go env && go mod download
+
+RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o dubbo-cp ./app/dubbo-cp/main.go
+
+# Use distroless as minimal base image to package the manager binary
+# Refer to https://github.com/GoogleContainerTools/distroless for more details
+FROM gcr.io/distroless/static:nonroot
+WORKDIR /
+COPY --from=builder /app/dubbo-cp .
+USER 65532:65532
+
+ENTRYPOINT ["./dubbo-cp","run"]
\ No newline at end of file