Dockerfile 458 字节
FROM golang:1.13 as builder

ENV GOPROXY https://goproxy.cn
ENV GOPATH /go
ENV APP_DIR $GOPATH/src/oppmg
# Recompile the standard library without CGO
RUN CGO_ENABLED=0 go install -a std

RUN mkdir -p $APP_DIR
# Set the entrypoint
#ENTRYPOINT (cd $APP_DIR && ./\src\oppmg)
ADD . $APP_DIR

# Compile the binary and statically link
RUN cd $APP_DIR && CGO_ENABLED=0  go build -mod=vendor -ldflags '-d -w -s' -o oppmg
WORKDIR $APP_DIR
EXPOSE 8080
CMD ["./oppmg"]