1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-24 08:32:22 +02:00
revive/Dockerfile

23 lines
527 B
Docker
Raw Normal View History

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}"
FROM scratch
2024-10-24 17:56:51 +02:00
COPY --from=build /src/revive /revive
ENTRYPOINT ["/revive"]