muyu-apiserver/deploy/Dockerfile.gateway
Chever John 4547ce7fed fix: use Harbor base images and Chinese Go proxy for CI builds
Docker Hub and proxy.golang.org unreachable from k3s cluster (GFW).
Switch Dockerfiles to Harbor base images and goproxy.cn.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-17 10:17:39 +08:00

19 lines
578 B
Docker

ARG BASE_REGISTRY=harbor-in-k3s.cheverjohn.me/library
FROM ${BASE_REGISTRY}/golang:1.24-alpine AS builder
ENV GOPROXY=https://goproxy.cn,direct
RUN apk add --no-cache git
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server ./gateway/gateway.go
FROM ${BASE_REGISTRY}/alpine:3.20
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=builder /server ./gateway
COPY deploy/etc/gateway.yaml etc/gateway.yaml
COPY deploy/tools/ tools/
EXPOSE 8888
CMD ["./gateway", "-f", "etc/gateway.yaml"]