Skip to content

Commit 43d9378

Browse files
committed
Bugfix
1 parent f0a05a3 commit 43d9378

File tree

5 files changed

+58
-67
lines changed

5 files changed

+58
-67
lines changed

Dockerfile

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ FROM mvdan/shfmt:latest-alpine as shfmt
2121
FROM hadolint/hadolint:v2.12.0-alpine as hadolint
2222
FROM mstruebing/editorconfig-checker:2.7.0 as editorconfig-checker
2323
FROM dotenvlinter/dotenv-linter:latest as dotenvlinter
24+
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
25+
## The golang image used as a builder is a temporary workaround
26+
## for the released revive binaries not returning version numbers (devel).
27+
## The install command should then be what is commented in the go.megalinter-descriptor.yml
28+
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
29+
ARG BUILDARCH
30+
ARG TARGETARCH
31+
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
32+
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
33+
FROM golang:1-alpine as revive
34+
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
35+
# Verify Binary
36+
RUN /usr/bin/revive --version
37+
2438
FROM ghcr.io/yannh/kubeconform:latest-alpine as kubeconform
2539
FROM ghcr.io/assignuser/chktex-alpine:latest as chktex
2640
FROM mrtazz/checkmake:latest as checkmake
@@ -850,22 +864,6 @@ esac \
850864
&& wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \
851865
&& golangci-lint --version
852866

853-
#
854-
# revive installation
855-
## The golang image used as a builder is a temporary workaround
856-
## for the released revive binaries not returning version numbers (devel).
857-
## The install command should then be what is commented in the go.megalinter-descriptor.yml
858-
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
859-
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
860-
ARG BUILDARCH
861-
ARG TARGETARCH
862-
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
863-
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
864-
FROM golang:1-alpine as revive
865-
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
866-
# Verify Binary
867-
RUN /usr/bin/revive --version
868-
869867
#
870868
# checkstyle installation
871869
RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \

flavors/cupcake/Dockerfile

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ FROM mvdan/shfmt:latest-alpine as shfmt
2222
FROM hadolint/hadolint:v2.12.0-alpine as hadolint
2323
FROM mstruebing/editorconfig-checker:2.7.0 as editorconfig-checker
2424
FROM 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+
2539
FROM ghcr.io/yannh/kubeconform:latest-alpine as kubeconform
2640
FROM mrtazz/checkmake:latest as checkmake
2741
FROM ghcr.io/phpstan/phpstan:latest-php8.1 as phpstan
@@ -634,22 +648,6 @@ RUN curl --retry 5 --retry-delay 5 -sLO https://raw.githubusercontent.com/clj-ko
634648
&& wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \
635649
&& golangci-lint --version
636650

637-
#
638-
# revive installation
639-
## The golang image used as a builder is a temporary workaround
640-
## for the released revive binaries not returning version numbers (devel).
641-
## The install command should then be what is commented in the go.megalinter-descriptor.yml
642-
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
643-
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
644-
ARG BUILDARCH
645-
ARG TARGETARCH
646-
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
647-
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
648-
FROM golang:1-alpine as revive
649-
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
650-
# Verify Binary
651-
RUN /usr/bin/revive --version
652-
653651
#
654652
# checkstyle installation
655653
RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \

flavors/go/Dockerfile

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ FROM mvdan/shfmt:latest-alpine as shfmt
2222
FROM hadolint/hadolint:v2.12.0-alpine as hadolint
2323
FROM mstruebing/editorconfig-checker:2.7.0 as editorconfig-checker
2424
FROM 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+
2539
FROM ghcr.io/yannh/kubeconform:latest-alpine as kubeconform
2640
FROM mrtazz/checkmake:latest as checkmake
2741
FROM yoheimuta/protolint:latest as protolint
@@ -392,27 +406,10 @@ COPY --from=copy-collector / /
392406
#OTHER__START
393407
# golangci-lint installation
394408
RUN 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
#

linters/go_revive/Dockerfile

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@
1111
## @generated by .automation/build.py using descriptor files, please do not update manually ##
1212
#############################################################################################
1313
#FROM__START
14+
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
15+
## The golang image used as a builder is a temporary workaround
16+
## for the released revive binaries not returning version numbers (devel).
17+
## The install command should then be what is commented in the go.megalinter-descriptor.yml
18+
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
19+
ARG BUILDARCH
20+
ARG TARGETARCH
21+
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
22+
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
23+
FROM golang:1-alpine as revive
24+
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
25+
# Verify Binary
26+
RUN /usr/bin/revive --version
1427

1528
#FROM__END
1629

@@ -215,22 +228,7 @@ COPY --from=copy-collector / /
215228
## @generated by .automation/build.py using descriptor files, please do not update manually ##
216229
#############################################################################################
217230
#OTHER__START
218-
# revive installation
219-
## The golang image used as a builder is a temporary workaround
220-
## for the released revive binaries not returning version numbers (devel).
221-
## The install command should then be what is commented in the go.megalinter-descriptor.yml
222-
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
223-
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
224-
ARG BUILDARCH
225-
ARG TARGETARCH
226-
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
227-
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
228-
FROM golang:1-alpine as revive
229-
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
230-
# Verify Binary
231-
RUN /usr/bin/revive --version
232231

233-
#
234232
#OTHER__END
235233

236234
###########################

megalinter/descriptors/go.megalinter-descriptor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ linters:
8585
# - FROM ghcr.io/mgechev/revive:1.2.5 as revive
8686
# - COPY --link --from=revive /usr/bin/revive /usr/bin/revive
8787
- |
88+
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
8889
## The golang image used as a builder is a temporary workaround
8990
## for the released revive binaries not returning version numbers (devel).
9091
## The install command should then be what is commented in the go.megalinter-descriptor.yml
91-
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
9292
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
9393
ARG BUILDARCH
9494
ARG TARGETARCH

0 commit comments

Comments
 (0)