feat: 修复报错
This commit is contained in:
20
go-service/Dockerfile
Normal file
20
go-service/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
ARG DOCKER_MIRROR_PREFIX=m.daocloud.io/docker.io/library
|
||||
FROM ${DOCKER_MIRROR_PREFIX}/golang:1.22-bookworm
|
||||
|
||||
ENV GOPROXY=https://goproxy.cn,direct \
|
||||
GOSUMDB=sum.golang.google.cn \
|
||||
CGO_ENABLED=0
|
||||
|
||||
RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources \
|
||||
&& sed -i 's|security.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod ./
|
||||
RUN go mod tidy || true
|
||||
|
||||
COPY . .
|
||||
RUN go mod tidy
|
||||
RUN go build -o /bin/go-service main.go
|
||||
|
||||
CMD ["/bin/go-service"]
|
||||
Reference in New Issue
Block a user