feat: 使用新的golang版本构建镜像

This commit is contained in:
lovezsh 2024-08-26 22:02:40 +08:00
parent bfd7729e09
commit aa545a2a9b
1 changed files with 11 additions and 0 deletions

11
Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM golang:1.22.4-alpine3.20 as builder
WORKDIR /builder
COPY . .
RUN GOPROXY=https://goproxy.cn CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o nip cmd/main.go
FROM alpine:3.20
WORKDIR /app
COPY --from=builder /builder/nip .
ENTRYPOINT [ "/app/nip" ]