@@ -634,39 +634,46 @@ RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version 0.7.104 \
634
634
&& find ${ML_THIRD_PARTY_DIR} -type f -not -name 'LICENSE*' -delete -o -type d -empty -delete \
635
635
&& find /tmp -path '/tmp/tmp.*' -type f -name 'misspell*' -delete -o -type d -empty -delete \
636
636
637
- # tsqllint installation
638
- # Next line commented because already managed by another linter
639
- # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \
640
- # && chmod +x dotnet-install.sh \
641
- # && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest
642
- # Next line commented because already managed by another linter
643
- # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet"
637
+ # tsqllint installation
638
+ # Next line commented because already managed by another linter
639
+ # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \
640
+ # && chmod +x dotnet-install.sh \
641
+ # && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest
642
+ # Next line commented because already managed by another linter
643
+ # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet"
644
644
&& dotnet tool install --global TSQLLint \
645
645
646
- # tflint installation
647
- # Managed with COPY --link --from=tflint /usr/local/bin/tflint /usr/bin/
646
+ # tflint installation
647
+ # Managed with COPY --link --from=tflint /usr/local/bin/tflint /usr/bin/
648
648
649
- # terrascan installation
650
- # Managed with COPY --link --from=terrascan /go/bin/terrascan /usr/bin/
649
+ # terrascan installation
650
+ # Managed with COPY --link --from=terrascan /go/bin/terrascan /usr/bin/
651
651
652
- # terragrunt installation
653
- # Managed with COPY --link --from=terragrunt /usr/local/bin/terragrunt /usr/bin/
652
+ # terragrunt installation
653
+ # Managed with COPY --link --from=terragrunt /usr/local/bin/terragrunt /usr/bin/
654
654
655
- # terraform-fmt installation
656
- # Managed with COPY --link --from=terragrunt /bin/terraform /usr/bin/
655
+ # terraform-fmt installation
656
+ # Managed with COPY --link --from=terragrunt /bin/terraform /usr/bin/
657
657
658
- # kics installation
659
- # Managed with COPY --link --from=kics /app/bin/kics /usr/bin/
658
+ # kics installation
659
+ # Managed with COPY --link --from=kics /app/bin/kics /usr/bin/
660
660
&& mkdir -p /opt/kics/assets
661
661
ENV KICS_QUERIES_PATH=/opt/kics/assets/queries KICS_LIBRARIES_PATH=/opt/kics/assets/libraries
662
662
# Managed with COPY --from=kics /app/bin/assets /opt/kics/assets/
663
663
664
664
# OTHER__END
665
665
666
+ # ######################################
667
+ # Create and activate megalinter user #
668
+ # ######################################
669
+ RUN groupadd --gid 1000 megalinter \
670
+ && adduser --uid 1000 megalinter
671
+ USER megalinter
672
+
666
673
# ###############################
667
674
# Installs python dependencies #
668
675
# ###############################
669
- COPY megalinter /megalinter
676
+ COPY --chown=megalinter:megalinter megalinter /megalinter
670
677
RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \
671
678
&& PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \
672
679
&& rm -rf /var/cache/apk/* \
@@ -675,8 +682,8 @@ RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \
675
682
# ######################################
676
683
# Copy scripts and rules to container #
677
684
# ######################################
678
- COPY megalinter/descriptors /megalinter-descriptors
679
- COPY TEMPLATES /action/lib/.automation
685
+ COPY --chown=megalinter:megalinter megalinter/descriptors /megalinter-descriptors
686
+ COPY --chown=megalinter:megalinter TEMPLATES /action/lib/.automation
680
687
681
688
# ##########################
682
689
# Get the build arguments #
0 commit comments