File: Dockerfile

package info (click to toggle)
go-md2man-v2 2.0.2%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, bookworm-proposed-updates, sid
  • size: 152 kB
  • sloc: makefile: 30; sh: 9
file content (20 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (2)
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"]