moth/Dockerfile.moth

15 lines
363 B
Docker

FROM golang:1.12.0-alpine AS builder
RUN apk add --no-cache git gcc musl-dev
COPY src /go/src/github.com/dirtbags/moth/src
WORKDIR /go/src/github.com/dirtbags/moth/src
RUN go get .
RUN CGO_ENABLED=1 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o /mothd *.go
FROM scratch
COPY --from=builder /mothd /mothd
COPY theme /theme
ENTRYPOINT [ "/mothd" ]