-
-
Notifications
You must be signed in to change notification settings - Fork 237
/
Dockerfile
884 lines (838 loc) · 41.6 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
# syntax=docker/dockerfile:1
###########################################
###########################################
## Dockerfile to run MegaLinter ##
###########################################
###########################################
# @not-generated
#############################################################################################
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#ARGTOP__START
# renovate: datasource=docker depName=rhysd/actionlint
ARG ACTION_ACTIONLINT_VERSION=1.7.3
# renovate: datasource=docker depName=koalaman/shellcheck
ARG BASH_SHELLCHECK_VERSION=v0.10.0
# renovate: datasource=docker depName=hadolint/hadolint
ARG DOCKERFILE_HADOLINT_VERSION=v2.12.0-alpine
# renovate: datasource=docker depName=mstruebing/editorconfig-checker
ARG EDITORCONFIG_EDITORCONFIG_CHECKER_VERSION=v3.0.3
# renovate: datasource=docker depName=ghcr.io/yannh/kubeconform
ARG KUBERNETES_KUBECONFORM_VERSION=v0.6.7-alpine
# renovate: datasource=docker depName=yoheimuta/protolint
ARG PROTOBUF_PROTOLINT_VERSION=0.50.5
# renovate: datasource=docker depName=zricethezav/gitleaks
ARG REPOSITORY_GITLEAKS_VERSION=v8.21.2
# renovate: datasource=docker depName=checkmarx/kics
ARG REPOSITORY_KICS_VERSION=v2.1.3-alpine
# renovate: datasource=docker depName=trufflesecurity/trufflehog
ARG REPOSITORY_TRUFFLEHOG_VERSION=3.83.2
# renovate: datasource=docker depName=jdkato/vale
ARG SPELL_VALE_VERSION=v3.8.0
# renovate: datasource=docker depName=ghcr.io/terraform-linters/tflint
ARG TERRAFORM_TFLINT_VERSION=0.53.0
# renovate: datasource=docker depName=tenable/terrascan
ARG TERRAFORM_TERRASCAN_VERSION=1.19.9
# renovate: datasource=docker depName=alpine/terragrunt
ARG TERRAFORM_TERRAGRUNT_VERSION=1.9.8
#ARGTOP__END
#############################################################################################
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#FROM__START
FROM rhysd/actionlint:${ACTION_ACTIONLINT_VERSION} AS actionlint
# shellcheck is a dependency for actionlint
FROM koalaman/shellcheck:${BASH_SHELLCHECK_VERSION} AS shellcheck
# Next FROM line commented because already managed by another linter
# FROM koalaman/shellcheck:${BASH_SHELLCHECK_VERSION} AS shellcheck
FROM mvdan/shfmt:latest-alpine AS shfmt
FROM hadolint/hadolint:${DOCKERFILE_HADOLINT_VERSION} AS hadolint
FROM mstruebing/editorconfig-checker:${EDITORCONFIG_EDITORCONFIG_CHECKER_VERSION} AS editorconfig-checker
FROM golang:1-alpine AS revive
## The golang image used as a builder is a temporary workaround (https://github.com/mgechev/revive/issues/787)
## for the released revive binaries not returning version numbers (devel).
## The install command should then be what is commented in the go.megalinter-descriptor.yml
# renovate: datasource=github-tags depName=mgechev/revive
ARG GO_REVIVE_VERSION=v1.4.0
RUN GOBIN=/usr/bin go install github.com/mgechev/revive@$GO_REVIVE_VERSION
FROM ghcr.io/yannh/kubeconform:${KUBERNETES_KUBECONFORM_VERSION} AS kubeconform
FROM ghcr.io/assignuser/chktex-alpine:latest AS chktex
FROM yoheimuta/protolint:${PROTOBUF_PROTOLINT_VERSION} AS protolint
FROM golang:alpine AS dustilock
RUN GOBIN=/usr/bin go install github.com/checkmarx/[email protected]
FROM zricethezav/gitleaks:${REPOSITORY_GITLEAKS_VERSION} AS gitleaks
FROM checkmarx/kics:${REPOSITORY_KICS_VERSION} AS kics
FROM trufflesecurity/trufflehog:${REPOSITORY_TRUFFLEHOG_VERSION} AS trufflehog
FROM jdkato/vale:${SPELL_VALE_VERSION} AS vale
FROM lycheeverse/lychee:latest-alpine AS lychee
FROM ghcr.io/terraform-linters/tflint:v${TERRAFORM_TFLINT_VERSION} AS tflint
FROM tenable/terrascan:${TERRAFORM_TERRASCAN_VERSION} AS terrascan
FROM alpine/terragrunt:${TERRAFORM_TERRAGRUNT_VERSION} AS terragrunt
# Next FROM line commented because already managed by another linter
# FROM alpine/terragrunt:${TERRAFORM_TERRAGRUNT_VERSION} AS terragrunt
#FROM__END
##################
# Build wheel for megalinter python package
##################
FROM ghcr.io/astral-sh/uv:0.4.28 AS uv
FROM python:3.12.7-alpine3.20 AS build-ml-core
WORKDIR /
COPY pyproject.toml .
COPY --from=uv /uv /bin/uv
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install --system -r pyproject.toml
COPY . .
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install --system .
##################
# Get base image #
##################
FROM python:3.12.7-alpine3.20
#############################################################################################
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#ARG__START
# renovate: datasource=npm depName=@salesforce/cli
ARG SALESFORCE_CLI_VERSION=2.63.9
# renovate: datasource=npm depName=@salesforce/plugin-packaging
ARG SALESFORCE_PLUGIN_PACKAGING_VERSION=2.8.12
# renovate: datasource=npm depName=sfdx-hardis
ARG SFDX_HARDIS_VERSION=5.5.0
ARG ARM_TTK_NAME='master.zip'
ARG ARM_TTK_URI='https://github.com/Azure/arm-ttk/archive/master.zip'
ARG ARM_TTK_DIRECTORY='/opt/microsoft'
ARG BICEP_EXE='bicep'
ARG BICEP_URI='https://github.com/Azure/bicep/releases/latest/download/bicep-linux-musl-x64'
ARG BICEP_DIR='/usr/local/bin'
ARG DART_VERSION='2.8.4'
# renovate: datasource=github-tags depName=pmd/pmd extractVersion=^pmd_releases/(?<version>.*)$
ARG PMD_VERSION=7.7.0
# renovate: datasource=github-tags depName=detekt/detekt
ARG DETEKT_VERSION=1.23.7
# renovate: datasource=crate depName=selene
ARG LUA_SELENE_VERSION=0.27.1
# renovate: datasource=crate depName=stylua
ARG LUA_STYLUA_VERSION=0.20.0
# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/
ARG PSSA_VERSION='1.23.0'
# renovate: datasource=npm depName=@salesforce/sfdx-scanner
ARG SALESFORCE_SFDX_SCANNER_VERSION=4.6.0
# renovate: datasource=npm depName=lightning-flow-scanner
ARG LIGHTNING_FLOW_SCANNER_VERSION=2.34.0
#ARG__END
####################
# Run APK installs #
####################
WORKDIR /
#############################################################################################
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#APK__START
RUN apk add --no-cache \
bash \
ca-certificates \
curl \
gcc \
git \
git-lfs \
libffi-dev \
make \
musl-dev \
openssh \
docker \
openrc \
icu-libs \
go \
openjdk21 \
readline-dev \
perl \
perl-dev \
gnupg \
php83 \
php83-phar \
php83-mbstring \
php83-xmlwriter \
php83-tokenizer \
php83-ctype \
php83-curl \
php83-dom \
php83-opcache \
php83-openssl \
php83-common \
php83-simplexml \
dpkg \
py3-pyflakes \
clang17-extra-tools \
nodejs \
npm \
yarn \
openjdk17 \
helm \
gcompat \
libc6-compat \
libstdc++ \
openssl \
g++ \
libc-dev \
libcurl \
libgcc \
libxml2-dev \
libxml2-utils \
linux-headers \
R \
R-dev \
R-doc \
nodejs-current \
ruby \
ruby-dev \
ruby-bundler \
ruby-rdoc \
&& git config --global core.autocrlf true
#APK__END
# PATH for golang & python
ENV GOROOT=/usr/lib/go \
GOPATH=/go
# PYTHONPYCACHEPREFIX="$HOME/.cache/cpython/" NV: not working for all packages :/
# hadolint ignore=DL3044
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \
# Ignore npm package issues
yarn config set ignore-engines true || true
##############################
# Installs rust dependencies #
#############################################################################################
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#CARGO__START
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable \
&& export PATH="/root/.cargo/bin:${PATH}" \
&& rustup component add clippy && cargo install --force --locked sarif-fmt shellcheck-sarif selene@${LUA_SELENE_VERSION} stylua@${LUA_STYLUA_VERSION} \
&& rm -rf /root/.cargo/registry /root/.cargo/git /root/.cache/sccache
ENV PATH="/root/.cargo/bin:${PATH}"
#CARGO__END
################################
# Installs python dependencies #
#############################################################################################
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#PIPVENV__START
RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \
&& mkdir -p "/venvs/ansible-lint" && cd "/venvs/ansible-lint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir ansible-lint && deactivate && cd ./../.. \
&& mkdir -p "/venvs/cpplint" && cd "/venvs/cpplint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir cpplint && deactivate && cd ./../.. \
&& mkdir -p "/venvs/cfn-lint" && cd "/venvs/cfn-lint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir cfn-lint[sarif] && deactivate && cd ./../.. \
&& mkdir -p "/venvs/djlint" && cd "/venvs/djlint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir djlint && deactivate && cd ./../.. \
&& mkdir -p "/venvs/pylint" && cd "/venvs/pylint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir pylint typing-extensions && deactivate && cd ./../.. \
&& mkdir -p "/venvs/black" && cd "/venvs/black" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir black && deactivate && cd ./../.. \
&& mkdir -p "/venvs/flake8" && cd "/venvs/flake8" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir flake8 && deactivate && cd ./../.. \
&& mkdir -p "/venvs/isort" && cd "/venvs/isort" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir isort black && deactivate && cd ./../.. \
&& mkdir -p "/venvs/bandit" && cd "/venvs/bandit" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir bandit bandit_sarif_formatter bandit[toml] && deactivate && cd ./../.. \
&& mkdir -p "/venvs/mypy" && cd "/venvs/mypy" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir mypy && deactivate && cd ./../.. \
&& mkdir -p "/venvs/pyright" && cd "/venvs/pyright" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir pyright && deactivate && cd ./../.. \
&& mkdir -p "/venvs/ruff" && cd "/venvs/ruff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir ruff && deactivate && cd ./../.. \
&& mkdir -p "/venvs/checkov" && cd "/venvs/checkov" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir packaging checkov && deactivate && cd ./../.. \
&& mkdir -p "/venvs/semgrep" && cd "/venvs/semgrep" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir semgrep && deactivate && cd ./../.. \
&& mkdir -p "/venvs/rst-lint" && cd "/venvs/rst-lint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir Pygments restructuredtext_lint && deactivate && cd ./../.. \
&& mkdir -p "/venvs/rstcheck" && cd "/venvs/rstcheck" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir rstcheck[toml,sphinx] && deactivate && cd ./../.. \
&& mkdir -p "/venvs/rstfmt" && cd "/venvs/rstfmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir rstfmt && deactivate && cd ./../.. \
&& mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \
&& mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \
&& mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \
&& mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \
&& mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \
&& find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \
&& rm -rf /root/.cache
ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/cfn-lint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/bandit/bin:/venvs/mypy/bin:/venvs/pyright/bin:/venvs/ruff/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/rst-lint/bin:/venvs/rstcheck/bin:/venvs/rstfmt/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin
#PIPVENV__END
############################
# Install NPM dependencies #
#############################################################################################
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
ENV NODE_OPTIONS="--max-old-space-size=8192" \
NODE_ENV=production
#NPM__START
WORKDIR /node-deps
RUN npm --no-cache install --ignore-scripts --omit=dev \
@salesforce/cli@${SALESFORCE_CLI_VERSION} \
typescript \
@stoplight/spectral-cli \
@coffeelint/cli \
jscpd \
stylelint \
stylelint-config-standard \
stylelint-config-sass-guidelines \
stylelint-scss \
gherkin-lint \
graphql \
graphql-schema-linter \
npm-groovy-lint \
htmlhint \
eslint \
eslint-config-airbnb \
eslint-config-prettier \
eslint-config-standard \
eslint-plugin-import \
eslint-plugin-jest \
eslint-plugin-node \
eslint-plugin-prettier \
eslint-plugin-promise \
eslint-plugin-vue \
@babel/core \
@babel/eslint-parser \
@microsoft/eslint-formatter-sarif \
standard \
prettier \
@prantlf/jsonlint \
v8r \
npm-package-json-lint \
npm-package-json-lint-config-default \
eslint-plugin-react \
eslint-plugin-jsx-a11y \
markdownlint-cli \
markdown-link-check \
markdown-table-formatter \
@ls-lint/ls-lint \
secretlint \
@secretlint/secretlint-rule-preset-recommend \
@secretlint/secretlint-formatter-sarif \
cspell \
@ibm/tekton-lint \
prettyjson \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser \
ts-standard && \
echo "Cleaning npm cache…" \
&& npm cache clean --force || true \
&& echo "Changing owner of node_modules files…" \
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
&& echo "Removing extra node_module files…" \
&& find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete
WORKDIR /
#NPM__END
# Add node packages to path #
ENV PATH="/node-deps/node_modules/.bin:${PATH}" \
NODE_PATH="/node-deps/node_modules"
##############################
# Installs ruby dependencies #
#############################################################################################
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#GEM__START
RUN echo 'gem: --no-document' >> ~/.gemrc && \
gem install \
puppet-lint \
rubocop \
rubocop-github \
rubocop-performance \
rubocop-rails \
rubocop-rake \
rubocop-rspec
#GEM__END
##############################
# COPY instructions #
#############################################################################################
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#COPY__START
COPY --from=composer/composer:2-bin /composer /usr/bin/composer
COPY --link --from=actionlint /usr/local/bin/actionlint /usr/bin/actionlint
# shellcheck is a dependency for actionlint
COPY --link --from=shellcheck /bin/shellcheck /usr/bin/shellcheck
# Next COPY line commented because already managed by another linter
# COPY --link --from=shellcheck /bin/shellcheck /usr/bin/shellcheck
COPY --link --from=shfmt /bin/shfmt /usr/bin/
COPY --link --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
COPY --link --from=revive /usr/bin/revive /usr/bin/revive
COPY --link --from=kubeconform /kubeconform /usr/bin/
COPY --link --from=chktex /usr/bin/chktex /usr/bin/
COPY --link --from=protolint /usr/local/bin/protolint /usr/bin/
COPY --link --from=dustilock /usr/bin/dustilock /usr/bin/dustilock
COPY --link --from=gitleaks /usr/bin/gitleaks /usr/bin/
COPY --link --from=kics /app/bin/kics /usr/bin/kics
COPY --from=kics /app/bin/assets /usr/bin/assets
COPY --link --from=trufflehog /usr/bin/trufflehog /usr/bin/
COPY --link --from=vale /bin/vale /bin/vale
COPY --link --from=lychee /usr/local/bin/lychee /usr/bin/
COPY --link --from=tflint /usr/local/bin/tflint /usr/bin/
COPY --link --from=terrascan /go/bin/terrascan /usr/bin/
COPY --link --from=terragrunt /usr/local/bin/terragrunt /usr/bin/
COPY --link --from=terragrunt /bin/terraform /usr/bin/
#COPY__END
#############################################################################################
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#OTHER__START
RUN rc-update add docker boot && rc-service docker start || true \
# ARM installation
&& curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/powershell-7.4.2-linux-musl-x64.tar.gz -o /tmp/powershell.tar.gz \
&& mkdir -p /opt/microsoft/powershell/7 \
&& tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7 \
&& chmod +x /opt/microsoft/powershell/7/pwsh \
&& ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh
#
# CLOJURE installation
ENV LANG=C.UTF-8
RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" && \
ALPINE_GLIBC_PACKAGE_VERSION="2.34-r0" && \
ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \
echo \
"-----BEGIN PUBLIC KEY-----\
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApZ2u1KJKUu/fW4A25y9m\
y70AGEa/J3Wi5ibNVGNn1gT1r0VfgeWd0pUybS4UmcHdiNzxJPgoWQhV2SSW1JYu\
tOqKZF5QSN6X937PTUpNBjUvLtTQ1ve1fp39uf/lEXPpFpOPL88LKnDBgbh7wkCp\
m2KzLVGChf83MS0ShL6G9EQIAUxLm99VpgRjwqTQ/KfzGtpke1wqws4au0Ab4qPY\
KXvMLSPLUp7cfulWvhmZSegr5AdhNw5KNizPqCJT8ZrGvgHypXyiFvvAH5YRtSsc\
Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\
1QIDAQAB\
-----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \
wget --quiet --tries=10 --waitretry=10 \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
mv /etc/nsswitch.conf /etc/nsswitch.conf.bak && \
apk add --no-cache --force-overwrite \
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
\
mv /etc/nsswitch.conf.bak /etc/nsswitch.conf && \
rm "/etc/apk/keys/sgerrand.rsa.pub" && \
(/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true) && \
echo "export LANG=$LANG" > /etc/profile.d/locale.sh && \
\
apk del glibc-i18n && \
\
rm "/root/.wget-hsts" && \
apk del .build-dependencies && \
rm \
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" \
#
# CSHARP installation
&& apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"
#
# DART installation
# Next line commented because already managed by another linter
# ENV LANG=C.UTF-8
# Next line commented because already managed by another linter
# RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" && \
# ALPINE_GLIBC_PACKAGE_VERSION="2.34-r0" && \
# ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
# ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
# ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
# apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \
# echo \
# "-----BEGIN PUBLIC KEY-----\
# MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApZ2u1KJKUu/fW4A25y9m\
# y70AGEa/J3Wi5ibNVGNn1gT1r0VfgeWd0pUybS4UmcHdiNzxJPgoWQhV2SSW1JYu\
# tOqKZF5QSN6X937PTUpNBjUvLtTQ1ve1fp39uf/lEXPpFpOPL88LKnDBgbh7wkCp\
# m2KzLVGChf83MS0ShL6G9EQIAUxLm99VpgRjwqTQ/KfzGtpke1wqws4au0Ab4qPY\
# KXvMLSPLUp7cfulWvhmZSegr5AdhNw5KNizPqCJT8ZrGvgHypXyiFvvAH5YRtSsc\
# Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\
# 1QIDAQAB\
# -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \
# wget --quiet --tries=10 --waitretry=10 \
# "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
# "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
# "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
# mv /etc/nsswitch.conf /etc/nsswitch.conf.bak && \
# apk add --no-cache --force-overwrite \
# "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
# "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
# "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
# \
# mv /etc/nsswitch.conf.bak /etc/nsswitch.conf && \
# rm "/etc/apk/keys/sgerrand.rsa.pub" && \
# (/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true) && \
# echo "export LANG=$LANG" > /etc/profile.d/locale.sh && \
# \
# apk del glibc-i18n && \
# \
# rm "/root/.wget-hsts" && \
# apk del .build-dependencies && \
# rm \
# "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
# "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
# "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME"
#
# JAVA installation
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk
ENV PATH="$JAVA_HOME/bin:${PATH}"
#
# KOTLIN installation
# Next line commented because already managed by another linter
# ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk
# Next line commented because already managed by another linter
# ENV PATH="$JAVA_HOME/bin:${PATH}"
#
# LUA installation
RUN wget --tries=5 https://www.lua.org/ftp/lua-5.3.5.tar.gz -O - -q | tar -xzf - \
&& cd lua-5.3.5 \
&& make linux \
&& make install \
&& cd .. && rm -r lua-5.3.5/
#
# PHP installation
RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" \
&& export GITHUB_AUTH_TOKEN \
&& wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \
&& wget --tries=5 -q -O phive.phar.asc https://phar.io/releases/phive.phar.asc \
&& PHAR_KEY_ID="0x6AF725270AB81E04D79442549D8A98B29B2D5D79" \
&& ( gpg --keyserver hkps://keys.openpgp.org --recv-keys "$PHAR_KEY_ID" \
|| gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys "$PHAR_KEY_ID" \
|| gpg --keyserver keyserver.pgp.com --recv-keys "$PHAR_KEY_ID" \
|| gpg --keyserver pgp.mit.edu --recv-keys "$PHAR_KEY_ID" ) \
&& gpg --verify phive.phar.asc phive.phar \
&& chmod +x phive.phar \
&& mv phive.phar /usr/local/bin/phive \
&& rm phive.phar.asc \
&& update-alternatives --install /usr/bin/php php /usr/bin/php83 110
# Managed with COPY --from=composer/composer:2-bin /composer /usr/bin/composer
ENV PATH="/root/.composer/vendor/bin:${PATH}"
#
# POWERSHELL installation
# Next line commented because already managed by another linter
# RUN curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/powershell-7.4.2-linux-musl-x64.tar.gz -o /tmp/powershell.tar.gz \
# && mkdir -p /opt/microsoft/powershell/7 \
# && tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7 \
# && chmod +x /opt/microsoft/powershell/7/pwsh \
# && ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh
#
# SALESFORCE installation
# Next line commented because already managed by another linter
# ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk
# Next line commented because already managed by another linter
# ENV PATH="$JAVA_HOME/bin:${PATH}"
RUN sf plugins install @salesforce/plugin-packaging@${SALESFORCE_PLUGIN_PACKAGING_VERSION} \
&& echo y|sf plugins install sfdx-hardis@${SFDX_HARDIS_VERSION} \
&& npm cache clean --force || true \
&& rm -rf /root/.npm/_cacache
ENV SF_AUTOUPDATE_DISABLE=true SF_CLI_DISABLE_AUTOUPDATE=true
#
# SCALA installation
# Next line commented because already managed by another linter
# ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk
# Next line commented because already managed by another linter
# ENV PATH="$JAVA_HOME/bin:${PATH}"
RUN curl --retry-all-errors --retry 10 -fLo coursier https://git.io/coursier-cli && \
chmod +x coursier
#
# VBDOTNET installation
# Next line commented because already managed by another linter
# RUN apk add --no-cache dotnet8-sdk
# Next line commented because already managed by another linter
# ENV PATH="${PATH}:/root/.dotnet/tools"
#
# actionlint installation
# Managed with COPY --link --from=actionlint /usr/local/bin/actionlint /usr/bin/actionlint
# # shellcheck is a dependency for actionlint
# Managed with COPY --link --from=shellcheck /bin/shellcheck /usr/bin/shellcheck
#
# arm-ttk installation
ENV ARM_TTK_PSD1="${ARM_TTK_DIRECTORY}/arm-ttk-master/arm-ttk/arm-ttk.psd1"
RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \
&& unzip "${ARM_TTK_NAME}" -d "${ARM_TTK_DIRECTORY}" \
&& rm "${ARM_TTK_NAME}" \
&& ln -sTf "${ARM_TTK_PSD1}" /usr/bin/arm-ttk \
&& chmod a+x /usr/bin/arm-ttk \
#
# bash-exec installation
&& printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' > /usr/bin/bash-exec \
&& chmod +x /usr/bin/bash-exec \
#
# shellcheck installation
# Managed with # Next COPY line commented because already managed by another linter
# # COPY --link --from=shellcheck /bin/shellcheck /usr/bin/shellcheck
#
# shfmt installation
# Managed with COPY --link --from=shfmt /bin/shfmt /usr/bin/
#
# bicep_linter installation
&& curl --retry 5 --retry-delay 5 -sLo ${BICEP_EXE} "${BICEP_URI}" \
&& chmod +x "${BICEP_EXE}" \
&& mv "${BICEP_EXE}" "${BICEP_DIR}" \
#
# clj-kondo installation
&& curl --retry 5 --retry-delay 5 -sLO https://raw.githubusercontent.com/clj-kondo/clj-kondo/master/script/install-clj-kondo \
&& chmod +x install-clj-kondo \
&& ./install-clj-kondo \
#
# csharpier installation
&& dotnet tool install --global csharpier \
#
# roslynator installation
&& dotnet tool install -g roslynator.dotnet.cli \
#
# dartanalyzer installation
&& wget --tries=5 https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip -q - \
&& chmod +x dart-sdk/bin/dart* \
&& mv dart-sdk/bin/* /usr/bin/ && mv dart-sdk/lib/* /usr/lib/ && mv dart-sdk/include/* /usr/include/ \
&& rm -r dart-sdk/ \
#
# hadolint installation
# Managed with COPY --link --from=hadolint /bin/hadolint /usr/bin/hadolint
#
# editorconfig-checker installation
# Managed with COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
#
# dotenv-linter installation
&& wget -q -O - https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh | sh -s \
#
# golangci-lint installation
&& wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \
&& golangci-lint --version
#
# revive installation
# Managed with COPY --link --from=revive /usr/bin/revive /usr/bin/revive
#
# npm-groovy-lint installation
ENV JAVA_HOME_17=/usr/lib/jvm/java-17-openjdk
#
# checkstyle installation
RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
https://api.github.com/repos/checkstyle/checkstyle/releases/latest \
| grep browser_download_url \
| grep ".jar" \
| cut -d '"' -f 4) \
&& curl --retry 5 --retry-delay 5 -sSL $CHECKSTYLE_LATEST \
--output /usr/bin/checkstyle
#
# pmd installation
RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${PMD_VERSION}/pmd-dist-${PMD_VERSION}-bin.zip && \
unzip pmd-dist-${PMD_VERSION}-bin.zip || echo "Error unzipping" && \
rm pmd-dist-${PMD_VERSION}-bin.zip || echo "Error rm" && \
mv pmd-bin-${PMD_VERSION} /usr/bin/pmd || echo "Error mv" && \
chmod +x /usr/bin/pmd/bin/pmd || echo "Error chmod" \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/ \
#
# detekt installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/detekt/detekt/releases/download/v${DETEKT_VERSION}/detekt-cli-${DETEKT_VERSION}.zip && \
unzip detekt-cli-${DETEKT_VERSION}.zip && \
chmod a+x detekt-cli-${DETEKT_VERSION}/bin/* && \
chmod a+x detekt-cli-${DETEKT_VERSION}/lib/* && \
mv -n detekt-cli-${DETEKT_VERSION}/bin/* usr/bin && \
mv -n detekt-cli-${DETEKT_VERSION}/lib/* usr/lib \
#
# kubeconform installation
# Managed with COPY --link --from=kubeconform /kubeconform /usr/bin/
#
# kubescape installation
&& ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
curl --retry 5 --retry-delay 5 -sLv https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.9.0 \
#
# chktex installation
# Managed with COPY --link --from=chktex /usr/bin/chktex /usr/bin/
&& cd ~ && touch .chktexrc && cd / \
#
# luacheck installation
&& wget --tries=5 https://github.com/cvega/luarocks/archive/v3.3.1-super-linter.tar.gz -O - -q | tar -xzf - \
&& cd luarocks-3.3.1-super-linter \
&& ./configure --with-lua-include=/usr/local/include \
&& make \
&& make -b install \
&& cd .. && rm -r luarocks-3.3.1-super-linter/ \
&& luarocks install luacheck \
&& cd / \
#
# selene installation
#
# stylua installation
#
# perlcritic installation
&& curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm | perl - install -g --show-build-log-on-failure --without-build --without-test --without-runtime Perl::Critic \
&& rm -rf /root/.perl-cpm
#
# phpcs installation
RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && composer global require squizlabs/php_codesniffer bartlett/sarif-php-converters "1.0.x-dev#8ed4611 as 1.0.0"
#
# phpstan installation
RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && composer global require phpstan/phpstan bartlett/sarif-php-converters "1.0.x-dev#8ed4611 as 1.0.0"
#
# psalm installation
RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5
#
# phplint installation
RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && composer global require overtrue/phplint bartlett/sarif-php-converters "1.0.x-dev#8ed4611 as 1.0.0"
#
# php-cs-fixer installation
RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && composer global require friendsofphp/php-cs-fixer
#
# powershell installation
RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force'
#
# powershell_formatter installation
# Next line commented because already managed by another linter
# RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force'
#
# protolint installation
# Managed with COPY --link --from=protolint /usr/local/bin/protolint /usr/bin/
#
# mypy installation
ENV MYPY_CACHE_DIR=/tmp
#
# lintr installation
RUN mkdir -p /home/r-library \
&& cp -r /usr/lib/R/library/ /home/r-library/ \
&& Rscript -e "install.packages(c('lintr','purrr'), repos = 'https://cloud.r-project.org/')" \
&& R -e "install.packages(list.dirs('/home/r-library',recursive = FALSE), repos = NULL, type = 'source')" \
#
# raku installation
&& curl -L https://github.com/nxadm/rakudo-pkg/releases/download/v2020.10-02/rakudo-pkg-Alpine3.12_2020.10-02_x86_64.apk > rakudo-pkg-Alpine3.12_2020.10-02_x86_64.apk \
&& apk add --no-cache --allow-untrusted rakudo-pkg-Alpine3.12_2020.10-02_x86_64.apk \
&& rm rakudo-pkg-Alpine3.12_2020.10-02_x86_64.apk \
&& /opt/rakudo-pkg/bin/add-rakudo-to-path \
# && source /root/.profile \
&& /opt/rakudo-pkg/bin/install-zef-as-user
ENV PATH="~/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$PATH"
#
# devskim installation
# Next line commented because already managed by another linter
# RUN apk add --no-cache dotnet8-sdk
# Next line commented because already managed by another linter
# ENV PATH="${PATH}:/root/.dotnet/tools"
RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \
#
# dustilock installation
# Managed with COPY --link --from=dustilock /usr/bin/dustilock /usr/bin/dustilock
#
# gitleaks installation
# Managed with COPY --link --from=gitleaks /usr/bin/gitleaks /usr/bin/
#
# grype installation
&& curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin v0.79.5
#
# kics installation
# Managed with COPY --link --from=kics /app/bin/kics /usr/bin/kics
ENV KICS_QUERIES_PATH=/usr/bin/assets/queries KICS_LIBRARIES_PATH=/usr/bin/assets/libraries
# Managed with COPY --from=kics /app/bin/assets /usr/bin/assets
#
# syft installation
RUN curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin \
#
# trivy installation
&& wget --tries=5 -q -O - https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin \
&& trivy image --download-db-only --no-progress \
#
# trivy-sbom installation
# Next line commented because already managed by another linter
# RUN wget --tries=5 -q -O - https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin \
# && trivy image --download-db-only --no-progress
#
# trufflehog installation
# Managed with COPY --link --from=trufflehog /usr/bin/trufflehog /usr/bin/
#
# sfdx-scanner-apex installation
&& sf plugins install @salesforce/sfdx-scanner@${SALESFORCE_SFDX_SCANNER_VERSION} \
&& npm cache clean --force || true \
&& rm -rf /root/.npm/_cacache \
#
# sfdx-scanner-aura installation
# Next line commented because already managed by another linter
# RUN sf plugins install @salesforce/sfdx-scanner@${SALESFORCE_SFDX_SCANNER_VERSION} \
# && npm cache clean --force || true \
# && rm -rf /root/.npm/_cacache
#
# sfdx-scanner-lwc installation
# Next line commented because already managed by another linter
# RUN sf plugins install @salesforce/sfdx-scanner@${SALESFORCE_SFDX_SCANNER_VERSION} \
# && npm cache clean --force || true \
# && rm -rf /root/.npm/_cacache
#
# lightning-flow-scanner installation
&& echo y|sf plugins install lightning-flow-scanner@${LIGHTNING_FLOW_SCANNER_VERSION} \
&& npm cache clean --force || true \
&& rm -rf /root/.npm/_cacache \
#
# scalafix installation
&& ./coursier install scalafix --quiet --install-dir /usr/bin && rm -rf /root/.cache \
#
# vale installation
# Managed with COPY --link --from=vale /bin/vale /bin/vale
#
# lychee installation
# Managed with COPY --link --from=lychee /usr/local/bin/lychee /usr/bin/
#
# tsqllint installation
# Next line commented because already managed by another linter
# RUN apk add --no-cache dotnet8-sdk
# Next line commented because already managed by another linter
# ENV PATH="${PATH}:/root/.dotnet/tools"
&& dotnet tool install --global TSQLLint
#
# tflint installation
# Managed with COPY --link --from=tflint /usr/local/bin/tflint /usr/bin/
#
# terrascan installation
# Managed with COPY --link --from=terrascan /go/bin/terrascan /usr/bin/
#
# terragrunt installation
# Managed with COPY --link --from=terragrunt /usr/local/bin/terragrunt /usr/bin/
#
# terraform-fmt installation
# Managed with COPY --link --from=terragrunt /bin/terraform /usr/bin/
#
#OTHER__END
################################
# Installs python dependencies #
################################
COPY --from=build-ml-core pyproject.toml README.md ./
COPY --from=build-ml-core megalinter /megalinter/
RUN --mount=type=cache,target=/root/.cache/uv,from=build-ml-core \
--mount=from=uv,source=/uv,target=/bin/uv \
uv pip install --system -e .
#######################################
# Copy scripts and rules to container #
#######################################
COPY megalinter/descriptors /megalinter-descriptors
COPY TEMPLATES /action/lib/.automation
# Copy server scripts
COPY server /server
###########################
# Get the build arguments #
###########################
ARG BUILD_DATE
ARG BUILD_REVISION
ARG BUILD_VERSION
#################################################
# Set ENV values used for debugging the version #
#################################################
ENV BUILD_DATE=$BUILD_DATE \
BUILD_REVISION=$BUILD_REVISION \
BUILD_VERSION=$BUILD_VERSION
#FLAVOR__START
ENV MEGALINTER_FLAVOR=all
#FLAVOR__END
#########################################
# Label the instance and set maintainer #
#########################################
LABEL com.github.actions.name="MegaLinter" \
com.github.actions.description="The ultimate linters aggregator to make sure your projects are clean" \
com.github.actions.icon="code" \
com.github.actions.color="red" \
maintainer="Nicolas Vuillamy <[email protected]>" \
org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.revision=$BUILD_REVISION \
org.opencontainers.image.version=$BUILD_VERSION \
org.opencontainers.image.authors="Nicolas Vuillamy <[email protected]>" \
org.opencontainers.image.url="https://megalinter.io" \
org.opencontainers.image.source="https://github.com/oxsecurity/megalinter" \
org.opencontainers.image.documentation="https://megalinter.io" \
org.opencontainers.image.vendor="Nicolas Vuillamy" \
org.opencontainers.image.description="Lint your code base with GitHub Actions"
#EXTRA_DOCKERFILE_LINES__START
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x entrypoint.sh
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
#EXTRA_DOCKERFILE_LINES__END