summaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: b9fc4dfdb52a559d4d6a3f8757c74c40721a3f09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
ARG GO_VERSION=1.21

FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS build
COPY . /go/src/github.com/cpuguy83/go-md2man
WORKDIR /go/src/github.com/cpuguy83/go-md2man
ARG TARGETOS TARGETARCH TARGETVARIANT
RUN \
    --mount=type=cache,target=/go/pkg/mod \
    --mount=type=cache,target=/root/.cache/go-build \
    make build

FROM scratch
COPY --from=build /go/src/github.com/cpuguy83/go-md2man/bin/go-md2man /go-md2man
ENTRYPOINT ["/go-md2man"]