summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile14
1 files changed, 14 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..b9fc4df
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,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"]