mirror of
https://github.com/enix/x509-certificate-exporter.git
synced 2026-08-28 16:27:16 +00:00
38 lines
666 B
Docker
38 lines
666 B
Docker
ARG OS="linux"
|
|
|
|
ARG ARCH="amd64"
|
|
|
|
FROM --platform=${OS}/${ARCH} golang:1.16-alpine as build
|
|
|
|
ARG OS
|
|
|
|
ARG ARCH
|
|
|
|
WORKDIR $GOPATH/src/enix.io/x509-certificate-exporter
|
|
|
|
COPY go.mod go.mod
|
|
|
|
COPY go.sum go.sum
|
|
|
|
RUN go mod download
|
|
|
|
COPY internal internal
|
|
|
|
COPY cmd cmd
|
|
|
|
ENV GOOS=${OS}
|
|
|
|
ENV GOARCH=${ARCH}
|
|
|
|
ARG VERSION="0.0.0"
|
|
|
|
RUN go build -ldflags "-X \"enix.io/x509-certificate-exporter/internal.Version=${VERSION}\"" ./cmd/x509-certificate-exporter
|
|
|
|
###############
|
|
|
|
FROM --platform=${OS}/${ARCH} alpine:3.13
|
|
|
|
COPY --from=build /go/src/enix.io/x509-certificate-exporter/x509-certificate-exporter /x509-certificate-exporter
|
|
|
|
ENTRYPOINT [ "/x509-certificate-exporter" ]
|