You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
335 B
10 lines
335 B
# 编译
|
|
FROM golang:1.14-alpine
|
|
COPY . /build/
|
|
WORKDIR /build
|
|
RUN GOPROXY=https://goproxy.cn GOSUMDB=off GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-w -s' -o server
|
|
# 运行阶段
|
|
FROM scratch
|
|
# 从编译阶段的中拷贝编译结果到当前镜像中
|
|
COPY --from=0 /build/server /
|
|
ENTRYPOINT ["/server"] |