Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-go . /
COPY --from=stagex/core-ca-certificates . /
ADD fetch/go-md2man-${VERSION}.tar.gz .
WORKDIR /go-md2man-${VERSION}
ENV PWD=/home/user/go-md2man-${VERSION}
ENV GOPATH=${PWD}/cache/go
ENV GOCACHE=${PWD}/cache/
ENV GOWORK=off
ENV GOPROXY=https://proxy.golang.org,direct
ENV GOSUMDB=sum.golang.org
ENV CGO_ENABLED=0
ENV GOHOSTOS=linux
ENV GOHOSTARCH=amd64
RUN mkdir -p ${GOPATH}
RUN go get ./...
RUN <<-EOF
go build -o bin/go-md2man
mkdir -p /rootfs/usr/bin/
cp bin/go-md2man /rootfs/usr/bin/
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /