1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-19 17:12:55 +02:00
revive/Dockerfile
renovate[bot] 7fa1b2786d
chore(deps): update golang docker tag to v1.23 (#1071)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-25 09:33:34 -03:00

23 lines
527 B
Docker

FROM --platform=$BUILDPLATFORM golang:1.23 AS build
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
COPY --from=build /src/revive /revive
ENTRYPOINT ["/revive"]