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.
 
 
 
static-file-server/Dockerfile

24 lines
604 B

FROM golang:1.11.2 as builder
EXPOSE 8080
ENV BUILD_DIR /go/src/github.com/halverneus/static-file-server
ENV MAIN github.com/halverneus/static-file-server/bin/serve
ENV DEP_VERSION v0.5.0
RUN curl -fsSL -o /usr/local/bin/dep \
https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 && \
chmod +x /usr/local/bin/dep
RUN mkdir -p ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
COPY . .
RUN dep ensure -vendor-only
RUN go test -race -cover ./...
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o /serve ${MAIN}
FROM scratch
COPY --from=builder /serve /
ENTRYPOINT ["/serve"]
CMD []