blob: 7181c5306f41b39d20c4693fc7b0e2c068bdda71 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
ARG GO_VERSION=1.18
ARG GO_IMAGE=golang:${GO_VERSION}
FROM --platform=$BUILDPLATFORM $GO_IMAGE AS build
COPY . /go/src/github.com/cpuguy83/go-md2man
WORKDIR /go/src/github.com/cpuguy83/go-md2man
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
RUN \
export GOOS="${TARGETOS}"; \
export GOARCH="${TARGETARCH}"; \
if [ "${TARGETARCH}" = "arm" ] && [ "${TARGETVARIANT}" ]; then \
export GOARM="${TARGETVARIANT#v}"; \
fi; \
CGO_ENABLED=0 go build
FROM scratch
COPY --from=build /go/src/github.com/cpuguy83/go-md2man/go-md2man /go-md2man
ENTRYPOINT ["/go-md2man"]
|