@@ -22,6 +22,20 @@ FROM mvdan/shfmt:latest-alpine as shfmt
2222FROM hadolint/hadolint:v2.12.0-alpine as hadolint
2323FROM mstruebing/editorconfig-checker:2.7.0 as editorconfig-checker
2424FROM dotenvlinter/dotenv-linter:latest as dotenvlinter
25+ FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
26+ # # The golang image used as a builder is a temporary workaround
27+ # # for the released revive binaries not returning version numbers (devel).
28+ # # The install command should then be what is commented in the go.megalinter-descriptor.yml
29+ RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
30+ ARG BUILDARCH
31+ ARG TARGETARCH
32+ RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
33+ && ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
34+ FROM golang:1-alpine as revive
35+ COPY --from=revive-build /usr/bin/revive /usr/bin/revive
36+ # Verify Binary
37+ RUN /usr/bin/revive --version
38+
2539FROM ghcr.io/yannh/kubeconform:latest-alpine as kubeconform
2640FROM mrtazz/checkmake:latest as checkmake
2741FROM yoheimuta/protolint:latest as protolint
@@ -392,27 +406,10 @@ COPY --from=copy-collector / /
392406# OTHER__START
393407# golangci-lint installation
394408RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \
395- && golangci-lint --version
396-
397- #
398- # revive installation
399- # # The golang image used as a builder is a temporary workaround
400- # # for the released revive binaries not returning version numbers (devel).
401- # # The install command should then be what is commented in the go.megalinter-descriptor.yml
402- FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
403- RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
404- ARG BUILDARCH
405- ARG TARGETARCH
406- RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
407- && ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
408- FROM golang:1-alpine as revive
409- COPY --from=revive-build /usr/bin/revive /usr/bin/revive
410- # Verify Binary
411- RUN /usr/bin/revive --version
412-
409+ && golangci-lint --version \
413410#
414411# ktlint installation
415- RUN curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
412+ && curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
416413 chmod a+x ktlint && \
417414 mv "ktlint" /usr/bin/ \
418415#
0 commit comments