# 孔明 kmctl kaniko 构建(dockerfile 模式,无构建上下文) # 不 COPY 本地文件,从 Gitee 匿名 clone 源码编译(与 sglang 的 build-kmctl/Dockerfile 同套路)。 # 用法: kmctl --cluster <集群> create image responses-shim --build-mode dockerfile \ # --dockerfile Dockerfile.kaniko --node-group <节点组> --wait FROM uhub.service.ucloud.cn/umirror/golang:1.23 AS build RUN git clone --depth 1 https://gitee.com/ymkymkymkymx/responses-shim.git /src \ && cd /src \ && CGO_ENABLED=0 go build -ldflags="-s -w" -o /shim . \ && git rev-parse HEAD > /etc/shim-commit || true FROM scratch COPY --from=build /shim /shim EXPOSE 8080 ENTRYPOINT ["/shim"]