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.
20 lines
330 B
20 lines
330 B
FROM golang:1.11.3 as builder
|
|
|
|
EXPOSE 8080
|
|
|
|
ENV BUILD_DIR /build
|
|
|
|
RUN mkdir -p ${BUILD_DIR}
|
|
WORKDIR ${BUILD_DIR}
|
|
|
|
COPY go.* ./
|
|
RUN go mod download
|
|
COPY . .
|
|
|
|
RUN go test -cover ./...
|
|
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o /serve /build/bin/serve
|
|
|
|
FROM scratch
|
|
COPY --from=builder /serve /
|
|
ENTRYPOINT ["/serve"]
|
|
CMD []
|
|
|