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>
This commit is contained in:
parent
88f3aec0a7
commit
4547ce7fed
@ -1,4 +1,6 @@
|
||||
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
|
||||
RUN apk add --no-cache git
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
@ -6,7 +8,7 @@ RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server ./gateway/gateway.go
|
||||
|
||||
FROM alpine:3.20
|
||||
FROM ${BASE_REGISTRY}/alpine:3.20
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
WORKDIR /app
|
||||
COPY --from=builder /server ./gateway
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
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
|
||||
RUN apk add --no-cache git
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
@ -6,7 +8,7 @@ RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server ./rpc/inventory/inventory.go
|
||||
|
||||
FROM alpine:3.20
|
||||
FROM ${BASE_REGISTRY}/alpine:3.20
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
WORKDIR /app
|
||||
COPY --from=builder /server ./inventory
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
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
|
||||
RUN apk add --no-cache git
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
@ -6,7 +8,7 @@ RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server ./rpc/system/system.go
|
||||
|
||||
FROM alpine:3.20
|
||||
FROM ${BASE_REGISTRY}/alpine:3.20
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
WORKDIR /app
|
||||
COPY --from=builder /server ./system
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user