fix: 添加国内 Go 代理,移除自动安装插件,解决网络下载失败
This commit is contained in:
@@ -2,6 +2,8 @@ FROM golang:1.26.1-alpine3.23 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
|
||||
COPY go.mod ./
|
||||
COPY main.go ./
|
||||
|
||||
|
||||
@@ -2,14 +2,12 @@ FROM golang:1.26.1-alpine3.23 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
|
||||
COPY go.mod ./
|
||||
COPY main.go ./
|
||||
COPY user.proto ./
|
||||
|
||||
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
|
||||
|
||||
FROM alpine:3.23
|
||||
|
||||
Reference in New Issue
Block a user