mfer/Dockerfile

34 lines
732 B
Docker

## lint image
## current as of 2022-01-25
FROM golangci/golangci-lint@sha256:c833decc0e2e1ee64ab8c27074929c94db1ef3e230aaf848a0d9bf7795fe4f44 AS linter
RUN mkdir -p /build
WORKDIR /build
COPY ./ ./
RUN golangci-lint run
## build image:
# this is golang:1.17.6-buster as of 2022-01-27
FROM golang@sha256:52a48e0239f4d645b20ac268a60361703afe7feb2df5697fa89f72052cb87a3e AS builder
#FROM golang:1.16-buster AS builder
ENV DEBIAN_FRONTEND noninteractive
RUN apt update && apt install -y make bzip2
RUN mkdir -p /build
WORKDIR /build
COPY go.mod .
COPY go.sum .
COPY ./ ./
RUN make lint
RUN go mod vendor
RUN make
RUN tar -c . | bzip2 > /src.tbz2
#FROM scratch
#COPY --from=builder /src.tbz2 /
#COPY --from=builder /build/mfer /