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
|
RUN apk add --no-cache git
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
@ -6,7 +8,7 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server ./gateway/gateway.go
|
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
|
RUN apk add --no-cache ca-certificates tzdata
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /server ./gateway
|
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
|
RUN apk add --no-cache git
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
@ -6,7 +8,7 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server ./rpc/inventory/inventory.go
|
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
|
RUN apk add --no-cache ca-certificates tzdata
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /server ./inventory
|
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
|
RUN apk add --no-cache git
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
@ -6,7 +8,7 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server ./rpc/system/system.go
|
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
|
RUN apk add --no-cache ca-certificates tzdata
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /server ./system
|
COPY --from=builder /server ./system
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user