fix: use Harbor base images and Chinese Go proxy for CI builds

Docker Hub and proxy.golang.org are unreachable from k3s cluster
(GFW). Switch all Dockerfiles to pull base images from Harbor
(harbor-in-k3s.cheverjohn.me/library/) and use goproxy.cn for
Go module downloads.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Chever John 2026-06-17 10:17:36 +08:00
parent 6568d33c02
commit 475589b23f
No known key found for this signature in database
GPG Key ID: 2894D52ED1211DF0
5 changed files with 20 additions and 10 deletions

View File

@ -1,11 +1,13 @@
FROM golang:1.24-alpine AS builder
ARG BASE_REGISTRY=harbor-in-k3s.cheverjohn.me/library
FROM ${BASE_REGISTRY}/golang:1.24-alpine AS builder
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /app
COPY shared/ ./shared/
COPY auth-service/ ./auth-service/
WORKDIR /app/auth-service
RUN go build -o /auth-service ./cmd/
FROM alpine:3.20
FROM ${BASE_REGISTRY}/alpine:3.20
RUN apk add --no-cache wget
COPY --from=builder /auth-service /auth-service
EXPOSE 8081

View File

@ -1,11 +1,13 @@
FROM golang:1.24-alpine AS builder
ARG BASE_REGISTRY=harbor-in-k3s.cheverjohn.me/library
FROM ${BASE_REGISTRY}/golang:1.24-alpine AS builder
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /app
COPY shared/ ./shared/
COPY gateway/ ./gateway/
WORKDIR /app/gateway
RUN go build -o /gateway ./cmd/
FROM alpine:3.20
FROM ${BASE_REGISTRY}/alpine:3.20
RUN apk add --no-cache wget
COPY --from=builder /gateway /gateway
EXPOSE 8080

View File

@ -1,11 +1,13 @@
FROM golang:1.24-alpine AS builder
ARG BASE_REGISTRY=harbor-in-k3s.cheverjohn.me/library
FROM ${BASE_REGISTRY}/golang:1.24-alpine AS builder
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /app
COPY shared/ ./shared/
COPY purchaser-service/ ./purchaser-service/
WORKDIR /app/purchaser-service
RUN go build -o /purchaser-service ./cmd/
FROM alpine:3.20
FROM ${BASE_REGISTRY}/alpine:3.20
RUN apk add --no-cache wget
COPY --from=builder /purchaser-service /purchaser-service
EXPOSE 8082

View File

@ -1,11 +1,13 @@
FROM golang:1.24-alpine AS builder
ARG BASE_REGISTRY=harbor-in-k3s.cheverjohn.me/library
FROM ${BASE_REGISTRY}/golang:1.24-alpine AS builder
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /app
COPY shared/ ./shared/
COPY textile-service/ ./textile-service/
WORKDIR /app/textile-service
RUN go build -o /textile-service ./cmd/
FROM alpine:3.20
FROM ${BASE_REGISTRY}/alpine:3.20
RUN apk add --no-cache wget
COPY --from=builder /textile-service /textile-service
EXPOSE 8083

View File

@ -1,11 +1,13 @@
FROM golang:1.24-alpine AS builder
ARG BASE_REGISTRY=harbor-in-k3s.cheverjohn.me/library
FROM ${BASE_REGISTRY}/golang:1.24-alpine AS builder
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /app
COPY shared/ ./shared/
COPY washing-service/ ./washing-service/
WORKDIR /app/washing-service
RUN go build -o /washing-service ./cmd/
FROM alpine:3.20
FROM ${BASE_REGISTRY}/alpine:3.20
RUN apk add --no-cache wget
COPY --from=builder /washing-service /washing-service
EXPOSE 8084