ci(docker): 基础镜像切换为 Harbor 私有仓库并支持自定义 GOPROXY
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
1 parent
6eb8e379ac
commit
eefb6b6b43
1 file changed
+5
-3
+5
-3
@@ -1,6 +1,8 @@
|
|||||||
FROM golang:1.27.3-alpine AS builder
|
FROM harbor.vitatech.com.cn:19443/vitavideo/base-golang:1.27.3-alpine AS builder
|
||||||
RUN apk add --no-cache git openssh-client
|
RUN apk add --no-cache git openssh-client
|
||||||
ENV GOPRIVATE=git.vitatech.com.cn
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
ENV GOPROXY=${GOPROXY} \
|
||||||
|
GOPRIVATE=git.vitatech.com.cn
|
||||||
RUN git config --global url."ssh://git@git.vitatech.com.cn:12222/".insteadOf "https://git.vitatech.com.cn/" \
|
RUN git config --global url."ssh://git@git.vitatech.com.cn:12222/".insteadOf "https://git.vitatech.com.cn/" \
|
||||||
&& mkdir -p -m 0700 /root/.ssh
|
&& mkdir -p -m 0700 /root/.ssh
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
@@ -11,7 +13,7 @@ RUN --mount=type=ssh,required=true \
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN CGO_ENABLED=0 go build -mod=readonly -trimpath -o /out/api ./cmd/api
|
RUN CGO_ENABLED=0 go build -mod=readonly -trimpath -o /out/api ./cmd/api
|
||||||
|
|
||||||
FROM alpine:3.23
|
FROM harbor.vitatech.com.cn:19443/vitavideo/base-alpine:3.23
|
||||||
RUN apk add --no-cache ca-certificates tzdata
|
RUN apk add --no-cache ca-certificates tzdata
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /out/api ./api
|
COPY --from=builder /out/api ./api
|
||||||
|
|||||||
Reference in new issue
Block a user