mfer/Dockerfile

30 lines
552 B
Docker

## lint image
FROM golangci/golangci-lint:v1.50.1
RUN mkdir -p /build
WORKDIR /build
COPY ./ ./
RUN golangci-lint run
## build image:
FROM sneak/mfer-build AS builder
WORKDIR /build
COPY go.mod .
COPY go.sum .
COPY ./ ./
# 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
RUN make mfer.cmd
#RUN go mod vendor
RUN tar -c . | bzip2 > /src.tbz2
FROM scratch
COPY --from=builder /src.tbz2 /src.tbz2
COPY --from=builder /build/mfer.cmd /mfer
ENTRYPOINT ["/mfer"]