static-file-server/Dockerfile

36 lines
1.1 KiB
Docker
Raw Normal View History

################################################################################
## GO BUILDER
################################################################################
2019-09-26 04:05:52 +00:00
FROM golang:1.13.1 as builder
2019-09-26 04:05:52 +00:00
ENV VERSION 1.6.6
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 -tags netgo -installsuffix netgo -ldflags "-X github.com/halverneus/static-file-server/cli/version.version=${VERSION}" -o /serve /build/bin/serve
2017-06-23 14:28:11 +00:00
################################################################################
## DEPLOYMENT CONTAINER
################################################################################
2017-06-23 14:28:11 +00:00
FROM scratch
EXPOSE 8080
2017-06-23 14:28:11 +00:00
COPY --from=builder /serve /
ENTRYPOINT ["/serve"]
CMD []
# Metadata
LABEL life.apets.vendor="Halverneus" \
life.apets.url="https://github.com/halverneus/static-file-server" \
life.apets.name="Static File Server" \
life.apets.description="A tiny static file server" \
2019-09-26 04:05:52 +00:00
life.apets.version="v1.6.6" \
life.apets.schema-version="1.0"