Dockerfile
384 字节
FROM golang:1.13 as builder
ENV GOPROXY https://goproxy.cn
ENV GO111MODULE on
ENV GOPATH /go
RUN git clone http://gitlab.fjmaimaimai.com/mmm-go/gocomm.git /go/src/gocomm \
&& cd /go/src/gocomm \
&& git pull
WORKDIR /go/src/opp-building
COPY go.mod .
COPY . .
RUN GOOS=linux CGO_ENABLED=0 go build -ldflags="-s -w" -o opp-building main.go
EXPOSE 8080
CMD ["./opp-building"]