2024-10-25 14:33:34 +02:00
|
|
|
FROM --platform=$BUILDPLATFORM golang:1.23 AS build
|
2024-10-24 17:56:51 +02:00
|
|
|
|
|
|
|
ARG VERSION
|
|
|
|
ARG REVISION
|
|
|
|
ARG BUILDTIME
|
|
|
|
ARG BUILDER
|
|
|
|
|
|
|
|
ARG TARGETOS
|
|
|
|
ARG TARGETARCH
|
|
|
|
|
|
|
|
ENV CGO_ENABLED=0
|
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
|
|
|
|
-ldflags "-X github.com/mgechev/revive/cli.version=${VERSION} -X github.com/mgechev/revive/cli.commit=${REVISION} -X github.com/mgechev/revive/cli.date=${BUILDTIME} -X github.com/mgechev/revive/cli.builtBy=${BUILDER}"
|
|
|
|
|
2021-10-15 08:36:14 +02:00
|
|
|
FROM scratch
|
2024-10-24 17:56:51 +02:00
|
|
|
|
|
|
|
COPY --from=build /src/revive /revive
|
|
|
|
|
|
|
|
ENTRYPOINT ["/revive"]
|