mfer/Dockerfile

30 lines
552 B
Docker
Raw Normal View History

2022-02-02 05:36:20 +00:00
## lint image
2022-12-04 18:55:22 +00:00
FROM golangci/golangci-lint:v1.50.1
2022-02-02 05:36:20 +00:00
RUN mkdir -p /build
WORKDIR /build
COPY ./ ./
RUN golangci-lint run
## build image:
2022-12-04 18:55:22 +00:00
FROM sneak/mfer-build AS builder
2022-02-02 05:36:20 +00:00
WORKDIR /build
COPY go.mod .
COPY go.sum .
COPY ./ ./
2022-02-02 06:30:43 +00:00
# don't lint again during build because there's no golangci-lint in this
# image and we already did it in a previous stage
#RUN make lint
2022-12-04 09:19:21 +00:00
RUN make mfer.cmd
#RUN go mod vendor
2022-02-02 05:36:20 +00:00
RUN tar -c . | bzip2 > /src.tbz2
2022-02-02 05:47:30 +00:00
2022-02-02 06:17:13 +00:00
FROM scratch
COPY --from=builder /src.tbz2 /src.tbz2
2022-12-04 09:19:21 +00:00
COPY --from=builder /build/mfer.cmd /mfer
2022-02-02 06:17:13 +00:00
ENTRYPOINT ["/mfer"]