fix: 添加国内 Go 代理,移除自动安装插件,解决网络下载失败

This commit is contained in:
fish
2026-03-28 18:50:18 +08:00
parent faa9c36bf6
commit 28af154df4
2 changed files with 5 additions and 5 deletions

View File

@@ -2,6 +2,8 @@ FROM golang:1.26.1-alpine3.23 AS builder
WORKDIR /app WORKDIR /app
ENV GOPROXY=https://goproxy.cn,direct
COPY go.mod ./ COPY go.mod ./
COPY main.go ./ COPY main.go ./

View File

@@ -2,14 +2,12 @@ FROM golang:1.26.1-alpine3.23 AS builder
WORKDIR /app WORKDIR /app
ENV GOPROXY=https://goproxy.cn,direct
COPY go.mod ./ COPY go.mod ./
COPY main.go ./ COPY main.go ./
COPY user.proto ./
RUN go mod download RUN go mod download
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
RUN protoc --go_out=. --go-grpc_out=. user.proto
RUN go build -o user-svc main.go RUN go build -o user-svc main.go
FROM alpine:3.23 FROM alpine:3.23