Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Uses modern go in Dockerfile 2. Fix `make build` pre-reqs 3. Remove interim BUILDFLAGS handling Signed-off-by: Brian Goff <cpuguy83@gmail.com>
- Loading branch information
Showing
3 changed files
with
44 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
ARG GO_VERSION=1.18 | ||
ARG GO_IMAGE=golang:${GO_VERSION} | ||
ARG GO_VERSION=1.21 | ||
|
||
FROM --platform=$BUILDPLATFORM $GO_IMAGE AS build | ||
FROM golang:${GO_VERSION} 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 | ||
--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/go-md2man /go-md2man | ||
COPY --from=build /go/src/github.com/cpuguy83/go-md2man/bin/go-md2man /go-md2man | ||
ENTRYPOINT ["/go-md2man"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters