Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: Use dotnet8-sdk available in the main repository #3696

Merged
merged 5 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# .NET sdk
# https://github.com/dotnet/sdk/issues/37790#issuecomment-1918068016
CVE-2024-0057

# Devskim
CVE-2018-8292
CVE-2019-0820
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Core
- Handle renovate version comments in build script
- Update base image to python:3.12.4-alpine3.20
- Use `dotnet8-sdk` available in the main repository

- Media

Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ FROM hadolint/hadolint:v2.12.0-alpine as hadolint
FROM mstruebing/editorconfig-checker:${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).
## 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
RUN GOBIN=/usr/bin go install github.com/mgechev/revive@latest

Expand Down Expand Up @@ -294,7 +294,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
&& 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
&& 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
Expand Down Expand Up @@ -412,7 +412,7 @@ RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" \

# CSHARP installation
&& apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
&& apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"

# DART installation
Expand Down Expand Up @@ -517,7 +517,7 @@ RUN sf plugins install @salesforce/plugin-packaging@${SALESFORCE_PLUGIN_PACKAGIN

# VBDOTNET installation
# Next line commented because already managed by another linter
# RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
# RUN apk add --no-cache dotnet8-sdk
# Next line commented because already managed by another linter
# ENV PATH="${PATH}:/root/.dotnet/tools"

Expand Down Expand Up @@ -700,7 +700,7 @@ ENV PATH="~/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$

# devskim installation
# Next line commented because already managed by another linter
# RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
# 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 \
Expand Down
2 changes: 1 addition & 1 deletion docs/descriptors/csharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ description: dotnet-format, csharpier, roslynator are available to analyze CSHAR

- Dockerfile commands :
```dockerfile
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"
```

2 changes: 1 addition & 1 deletion docs/descriptors/csharp_csharpier.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Options:
- Dockerfile commands :
```dockerfile
# Parent descriptor install
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"
# Linter install
RUN dotnet tool install --global csharpier
Expand Down
2 changes: 1 addition & 1 deletion docs/descriptors/csharp_roslynator.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Run 'roslynator help [command]' for more information on a command.
- Dockerfile commands :
```dockerfile
# Parent descriptor install
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"
# Linter install
RUN dotnet tool install -g roslynator.dotnet.cli
Expand Down
2 changes: 1 addition & 1 deletion docs/descriptors/repository_devskim.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ devskim 1.0.33+9dba5c6c1f

- Dockerfile commands :
```dockerfile
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"
RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI
```
Expand Down
2 changes: 1 addition & 1 deletion docs/descriptors/sql_tsqllint.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ tsqllint [options] [file.sql] | [dir] | [file.sql | dir]

- Dockerfile commands :
```dockerfile
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"
RUN dotnet tool install --global TSQLLint
```
Expand Down
2 changes: 1 addition & 1 deletion docs/descriptors/vbdotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ description: dotnet-format is available to analyze VBDOTNET files in MegaLinter

- Dockerfile commands :
```dockerfile
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"
```

6 changes: 3 additions & 3 deletions flavors/dotnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
&& 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
&& 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
Expand Down Expand Up @@ -256,7 +256,7 @@ RUN curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/po
&& ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh \

# CSHARP installation
&& apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
&& apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"

# KOTLIN installation
Expand All @@ -273,7 +273,7 @@ ENV PATH="$JAVA_HOME/bin:${PATH}"

# VBDOTNET installation
# Next line commented because already managed by another linter
# RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
# RUN apk add --no-cache dotnet8-sdk
# Next line commented because already managed by another linter
# ENV PATH="${PATH}:/root/.dotnet/tools"

Expand Down
6 changes: 3 additions & 3 deletions flavors/dotnetweb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
&& 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
&& 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
Expand Down Expand Up @@ -278,7 +278,7 @@ RUN curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/po
&& ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh \

# CSHARP installation
&& apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
&& apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"

# KOTLIN installation
Expand All @@ -295,7 +295,7 @@ ENV PATH="$JAVA_HOME/bin:${PATH}"

# VBDOTNET installation
# Next line commented because already managed by another linter
# RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
# RUN apk add --no-cache dotnet8-sdk
# Next line commented because already managed by another linter
# ENV PATH="${PATH}:/root/.dotnet/tools"

Expand Down
6 changes: 3 additions & 3 deletions flavors/formatters/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
&& 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
&& 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
Expand Down Expand Up @@ -164,7 +164,7 @@ COPY --link --from=terragrunt /bin/terraform /usr/bin/
#############################################################################################
#OTHER__START
# CSHARP installation
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"

# POWERSHELL installation
Expand All @@ -176,7 +176,7 @@ RUN curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/po

# VBDOTNET installation
# Next line commented because already managed by another linter
# RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
# RUN apk add --no-cache dotnet8-sdk
# Next line commented because already managed by another linter
# ENV PATH="${PATH}:/root/.dotnet/tools"

Expand Down
4 changes: 2 additions & 2 deletions flavors/security/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
&& 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
&& 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
Expand Down Expand Up @@ -206,7 +206,7 @@ RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: Fil
curl --retry 5 --retry-delay 5 -sLv https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.9.0 \

# devskim installation
&& apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
&& apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"
RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \

Expand Down
2 changes: 1 addition & 1 deletion linters/csharp_csharpier/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \
#############################################################################################
#OTHER__START
# CSHARP installation
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"

# csharpier installation
Expand Down
2 changes: 1 addition & 1 deletion linters/csharp_dotnet_format/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \
#############################################################################################
#OTHER__START
# CSHARP installation
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"

#OTHER__END
Expand Down
2 changes: 1 addition & 1 deletion linters/csharp_roslynator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \
#############################################################################################
#OTHER__START
# CSHARP installation
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"

# roslynator installation
Expand Down
2 changes: 1 addition & 1 deletion linters/repository_devskim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \
#############################################################################################
#OTHER__START
# devskim installation
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"
RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI

Expand Down
2 changes: 1 addition & 1 deletion linters/sql_tsqllint/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \
#############################################################################################
#OTHER__START
# tsqllint installation
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"
RUN dotnet tool install --global TSQLLint

Expand Down
2 changes: 1 addition & 1 deletion linters/vbdotnet_dotnet_format/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \
#############################################################################################
#OTHER__START
# VBDOTNET installation
RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN apk add --no-cache dotnet8-sdk
ENV PATH="${PATH}:/root/.dotnet/tools"

#OTHER__END
Expand Down
3 changes: 1 addition & 2 deletions megalinter/descriptors/csharp.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ file_extensions:
- ".cs"
install:
dockerfile:
# https://github.com/dotnet/sdk/issues/37790#issuecomment-1918068016
- RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
- RUN apk add --no-cache dotnet8-sdk
- ENV PATH="${PATH}:/root/.dotnet/tools"
linters:
# DOTNET FORMAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ linters:
- "devskim analyze --file-format sarif --options-json config --source-code ."
install:
dockerfile:
# https://github.com/dotnet/sdk/issues/37790#issuecomment-1918068016
- RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
- RUN apk add --no-cache dotnet8-sdk
- ENV PATH="${PATH}:/root/.dotnet/tools"
- RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI
ide:
Expand Down
3 changes: 1 addition & 2 deletions megalinter/descriptors/sql.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ linters:
- "tsqllint myfile.sql myfile2.sql"
install:
dockerfile:
# https://github.com/dotnet/sdk/issues/37790#issuecomment-1918068016
- RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
- RUN apk add --no-cache dotnet8-sdk
- ENV PATH="${PATH}:/root/.dotnet/tools"
- RUN dotnet tool install --global TSQLLint
ide:
Expand Down
3 changes: 1 addition & 2 deletions megalinter/descriptors/vbdotnet.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ file_extensions:
- ".vb"
install:
dockerfile:
# https://github.com/dotnet/sdk/issues/37790#issuecomment-1918068016
- RUN apk add --no-cache dotnet8-sdk --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
- RUN apk add --no-cache dotnet8-sdk
- ENV PATH="${PATH}:/root/.dotnet/tools"
linters:
# DOTNET FORMAT
Expand Down