1
+ # syntax=docker/dockerfile:1
1
2
# ##########################################
2
3
# ##########################################
3
4
# # Dockerfile to run MegaLinter ##
10
11
# # @generated by .automation/build.py using descriptor files, please do not update manually ##
11
12
# ############################################################################################
12
13
# FROM__START
14
+ FROM rhysd/actionlint:latest as actionlint
15
+ # shellcheck is a dependency for actionlint
16
+
17
+ FROM koalaman/shellcheck:stable as shellcheck
18
+ # Next FROM line commented because already managed by another linter
19
+ # FROM koalaman/shellcheck:stable as shellcheck
13
20
FROM mvdan/shfmt:latest-alpine as shfmt
14
21
FROM hadolint/hadolint:v2.12.0-alpine as hadolint
15
22
FROM mstruebing/editorconfig-checker:2.7.0 as editorconfig-checker
23
+ FROM golang:1.19-alpine as revive
24
+ # # The golang image used as a builder is a temporary workaround
25
+ # # for the released revive binaries not returning version numbers (devel).
26
+ # # The install command should then be what is commented in the go.megalinter-descriptor.yml
27
+ RUN GOBIN=/usr/bin go install github.com/mgechev/revive@latest
28
+
16
29
FROM ghcr.io/assignuser/chktex-alpine:latest as chktex
30
+ FROM mrtazz/checkmake:latest as checkmake
17
31
FROM yoheimuta/protolint:latest as protolint
32
+ FROM golang:alpine as dustilock
33
+ RUN GOBIN=/usr/bin go install github.com/checkmarx/
[email protected]
34
+
18
35
FROM zricethezav/gitleaks:v8.15.3 as gitleaks
19
36
FROM ghcr.io/terraform-linters/tflint:v0.45.0 as tflint
20
37
FROM tenable/terrascan:1.18.0 as terrascan
21
38
FROM alpine/terragrunt:latest as terragrunt
39
+ # Next FROM line commented because already managed by another linter
40
+ # FROM alpine/terragrunt:latest as terragrunt
22
41
FROM checkmarx/kics:alpine as kics
23
42
# FROM__END
24
43
@@ -69,7 +88,6 @@ RUN apk add --update --no-cache \
69
88
openssh \
70
89
docker \
71
90
openrc \
72
- go \
73
91
icu-libs \
74
92
libcurl \
75
93
libintl \
@@ -93,9 +111,11 @@ RUN apk add --update --no-cache \
93
111
php81-simplexml \
94
112
composer \
95
113
dpkg \
114
+ py3-pyflakes \
96
115
nodejs \
97
116
npm \
98
117
yarn \
118
+ go \
99
119
openssl \
100
120
readline-dev \
101
121
g++ \
@@ -280,17 +300,26 @@ ENV PATH="/root/.cargo/bin:${PATH}"
280
300
# ############################################################################################
281
301
282
302
# COPY__START
283
- COPY --from=shfmt /bin/shfmt /usr/bin/
284
- COPY --from=hadolint /bin/hadolint /usr/bin/hadolint
285
- COPY --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
286
- COPY --from=chktex /usr/bin/chktex /usr/bin/
287
- COPY --from=protolint /usr/local/bin/protolint /usr/bin/
288
- COPY --from=gitleaks /usr/bin/gitleaks /usr/bin/
289
- COPY --from=tflint /usr/local/bin/tflint /usr/bin/
290
- COPY --from=terrascan /go/bin/terrascan /usr/bin/
291
- COPY --from=terragrunt /usr/local/bin/terragrunt /usr/bin/
292
- COPY --from=terragrunt /bin/terraform /usr/bin/
293
- COPY --from=kics /app/bin/kics /usr/bin/
303
+ COPY --link --from=actionlint /usr/local/bin/actionlint /usr/bin/actionlint
304
+ # shellcheck is a dependency for actionlint
305
+
306
+ COPY --link --from=shellcheck /bin/shellcheck /usr/bin/shellcheck
307
+ # Next COPY line commented because already managed by another linter
308
+ # COPY --link --from=shellcheck /bin/shellcheck /usr/bin/shellcheck
309
+ COPY --link --from=shfmt /bin/shfmt /usr/bin/
310
+ COPY --link --from=hadolint /bin/hadolint /usr/bin/hadolint
311
+ COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
312
+ COPY --link --from=revive /usr/bin/revive /usr/bin/revive
313
+ COPY --link --from=chktex /usr/bin/chktex /usr/bin/
314
+ COPY --link --from=checkmake /checkmake /usr/bin/checkmake
315
+ COPY --link --from=protolint /usr/local/bin/protolint /usr/bin/
316
+ COPY --link --from=dustilock /usr/bin/dustilock /usr/bin/dustilock
317
+ COPY --link --from=gitleaks /usr/bin/gitleaks /usr/bin/
318
+ COPY --link --from=tflint /usr/local/bin/tflint /usr/bin/
319
+ COPY --link --from=terrascan /go/bin/terrascan /usr/bin/
320
+ COPY --link --from=terragrunt /usr/local/bin/terragrunt /usr/bin/
321
+ COPY --link --from=terragrunt /bin/terraform /usr/bin/
322
+ COPY --link --from=kics /app/bin/kics /usr/bin/
294
323
COPY --from=kics /app/bin/assets /opt/kics/assets/
295
324
# COPY__END
296
325
@@ -380,8 +409,9 @@ RUN echo y|sfdx plugins:install sfdx-hardis \
380
409
# ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet"
381
410
382
411
# actionlint installation
383
- ENV GO111MODULE=on
384
- RUN go install github.com/rhysd/actionlint/cmd/actionlint@latest && go clean --cache
412
+ # Managed with COPY --link --from=actionlint /usr/local/bin/actionlint /usr/bin/actionlint
413
+ # # shellcheck is a dependency for actionlint
414
+ # Managed with COPY --link --from=shellcheck /bin/shellcheck /usr/bin/shellcheck
385
415
386
416
# arm-ttk installation
387
417
ENV ARM_TTK_PSD1="${ARM_TTK_DIRECTORY}/arm-ttk-master/arm-ttk/arm-ttk.psd1"
@@ -396,14 +426,11 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \
396
426
&& chmod +x /usr/bin/bash-exec \
397
427
398
428
# shellcheck installation
399
- && ML_THIRD_PARTY_DIR="/third-party/shellcheck" \
400
- && mkdir -p ${ML_THIRD_PARTY_DIR} \
401
- && wget -qO- "https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz" | tar -xJv --directory ${ML_THIRD_PARTY_DIR} \
402
- && mv "${ML_THIRD_PARTY_DIR}/shellcheck-stable/shellcheck" /usr/bin/ \
403
- && find ${ML_THIRD_PARTY_DIR} -type f -not -name 'LICENSE*' -delete -o -type d -empty -delete \
429
+ # Managed with # Next COPY line commented because already managed by another linter
430
+ # # COPY --link --from=shellcheck /bin/shellcheck /usr/bin/shellcheck
404
431
405
432
# shfmt installation
406
- # Managed with COPY --from=shfmt /bin/shfmt /usr/bin/
433
+ # Managed with COPY --link -- from=shfmt /bin/shfmt /usr/bin/
407
434
408
435
# bicep_linter installation
409
436
&& curl --retry 5 --retry-delay 5 -sLo ${BICEP_EXE} "${BICEP_URI}" \
@@ -428,20 +455,21 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \
428
455
&& rm -r dart-sdk/ \
429
456
430
457
# hadolint installation
431
- # Managed with COPY --from=hadolint /bin/hadolint /usr/bin/hadolint
458
+ # Managed with COPY --link -- from=hadolint /bin/hadolint /usr/bin/hadolint
432
459
433
460
# editorconfig-checker installation
434
- # Managed with COPY --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
461
+ # Managed with COPY --link -- from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
435
462
436
463
# dotenv-linter installation
437
464
&& wget -q -O - https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh | sh -s \
438
465
439
466
# golangci-lint installation
440
467
&& wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \
441
- && golangci-lint --version \
468
+ && golangci-lint --version
469
+
442
470
443
471
# revive installation
444
- && go install github.com/mgechev/ revive@latest && go clean --cache
472
+ # Managed with COPY --link --from=revive /usr/bin/ revive /usr/bin/revive
445
473
446
474
# checkstyle installation
447
475
RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \
@@ -487,7 +515,7 @@ RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${P
487
515
&& find ${ML_THIRD_PARTY_DIR} -type f -not -name 'LICENSE*' -delete -o -type d -empty -delete \
488
516
489
517
# chktex installation
490
- # Managed with COPY --from=chktex /usr/bin/chktex /usr/bin/
518
+ # Managed with COPY --link -- from=chktex /usr/bin/chktex /usr/bin/
491
519
&& cd ~ && touch .chktexrc && cd / \
492
520
493
521
# luacheck installation
@@ -506,9 +534,7 @@ RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${P
506
534
&& cd / \
507
535
508
536
# checkmake installation
509
- && ( [ -d /usr/local/bin ] || mkdir -p /usr/local/bin ) \
510
- && wget -q "https://github.com/mrtazz/checkmake/releases/download/0.2.1/checkmake-0.2.1.linux.amd64" -O /usr/local/bin/checkmake \
511
- && chmod 755 /usr/local/bin/checkmake \
537
+ # Managed with COPY --link --from=checkmake /checkmake /usr/bin/checkmake
512
538
513
539
# perlcritic installation
514
540
&& curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic
@@ -537,7 +563,7 @@ RUN composer global require --ignore-platform-reqs overtrue/phplint ^5.3 \
537
563
# RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force'
538
564
539
565
# protolint installation
540
- # Managed with COPY --from=protolint /usr/local/bin/protolint /usr/bin/
566
+ # Managed with COPY --link -- from=protolint /usr/local/bin/protolint /usr/bin/
541
567
542
568
# lintr installation
543
569
&& mkdir -p /home/r-library \
@@ -565,18 +591,10 @@ ENV PATH="~/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$
565
591
RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \
566
592
567
593
# dustilock installation
568
- && ML_THIRD_PARTY_DIR=/download/dustilock && \
569
- mkdir -p ${ML_THIRD_PARTY_DIR} && \
570
- git clone https://github.com/Checkmarx/dustilock.git ${ML_THIRD_PARTY_DIR} && \
571
- cd ${ML_THIRD_PARTY_DIR} && \
572
- go build && go clean --cache && \
573
- chmod +x dustilock && \
574
- mv "${ML_THIRD_PARTY_DIR}/dustilock" /usr/bin/ && \
575
- find ${ML_THIRD_PARTY_DIR} -type f -not -name 'LICENSE*' -delete -o -type d -empty -delete && \
576
- cd / \
594
+ # Managed with COPY --link --from=dustilock /usr/bin/dustilock /usr/bin/dustilock
577
595
578
596
# gitleaks installation
579
- # Managed with COPY --from=gitleaks /usr/bin/gitleaks /usr/bin/
597
+ # Managed with COPY --link -- from=gitleaks /usr/bin/gitleaks /usr/bin/
580
598
581
599
# syft installation
582
600
&& curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin \
@@ -622,19 +640,19 @@ RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \
622
640
&& dotnet tool install --global TSQLLint \
623
641
624
642
# tflint installation
625
- # Managed with COPY --from=tflint /usr/local/bin/tflint /usr/bin/
643
+ # Managed with COPY --link -- from=tflint /usr/local/bin/tflint /usr/bin/
626
644
627
645
# terrascan installation
628
- # Managed with COPY --from=terrascan /go/bin/terrascan /usr/bin/
646
+ # Managed with COPY --link -- from=terrascan /go/bin/terrascan /usr/bin/
629
647
630
648
# terragrunt installation
631
- # Managed with COPY --from=terragrunt /usr/local/bin/terragrunt /usr/bin/
649
+ # Managed with COPY --link -- from=terragrunt /usr/local/bin/terragrunt /usr/bin/
632
650
633
651
# terraform-fmt installation
634
- # Managed with COPY --from=terragrunt /bin/terraform /usr/bin/
652
+ # Managed with COPY --link -- from=terragrunt /bin/terraform /usr/bin/
635
653
636
654
# kics installation
637
- # Managed with COPY --from=kics /app/bin/kics /usr/bin/
655
+ # Managed with COPY --link -- from=kics /app/bin/kics /usr/bin/
638
656
&& mkdir -p /opt/kics/assets
639
657
ENV KICS_QUERIES_PATH=/opt/kics/assets/queries KICS_LIBRARIES_PATH=/opt/kics/assets/libraries
640
658
# Managed with COPY --from=kics /app/bin/assets /opt/kics/assets/
0 commit comments