moth/Dockerfile

20 lines
440 B
Docker
Raw Normal View History

2020-09-11 21:24:24 -06:00
FROM golang:1.13 AS builder
COPY go.* /src/
COPY pkg /src/pkg/
COPY cmd /src/cmd/
2020-09-14 14:05:34 -06:00
COPY theme /target/theme/
COPY example-puzzles /target/puzzles/
COPY LICENSE.md /target/
2020-09-11 21:24:24 -06:00
WORKDIR /src/
RUN CGO_ENABLED=0 GOOS=linux go install -i -a -ldflags '-extldflags "-static"' ./...
2020-09-14 14:05:34 -06:00
RUN mkdir -p /target/bin
RUN cp /go/bin/* /target/bin/
FROM builder AS tester
RUN go test ./...
2020-09-11 21:24:24 -06:00
FROM scratch
2020-09-14 14:05:34 -06:00
COPY --from=builder /target /
2020-09-11 21:24:24 -06:00
2020-09-14 14:05:34 -06:00
ENTRYPOINT [ "/bin/mothd" ]