Skip to content

Commit aaf1050

Browse files
authored
Updates base image to python:3.13-alpine3.22 (#6133)
* Updates base image to python:3.13-alpine3.22 Updates the base Docker image for the build and runtime environments to python:3.13-alpine3.22. This ensures that the linter environment benefits from the latest security patches and updates available in the newer Alpine release. Fixes #6065 * Updates clang version to 20 Updates the clang version used in multiple Dockerfiles and MegaLinter descriptors from 19 to 20. This ensures that the latest clang tools are used for static analysis and formatting. * Increases test timeout duration Extends the test execution timeout to accommodate potentially longer test runs. This prevents premature termination of tests due to time constraints, ensuring more reliable test results. * Upgrade checkov * disable puppet-lint * [MegaLinter] Apply linters fixes * Disable checkov * [MegaLinter] Apply linters fixes --------- Co-authored-by: nvuillam <[email protected]>
1 parent 01ebe86 commit aaf1050

File tree

172 files changed

+327
-444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+327
-444
lines changed

.automation/generated/linters_matrix.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"powershell_powershell",
6464
"powershell_powershell_formatter",
6565
"protobuf_protolint",
66-
"puppet_puppet_lint",
6766
"python_pylint",
6867
"python_black",
6968
"python_flake8",
@@ -75,7 +74,6 @@
7574
"python_ruff_format",
7675
"r_lintr",
7776
"raku_raku",
78-
"repository_checkov",
7977
"repository_devskim",
8078
"repository_dustilock",
8179
"repository_git_diff",

.automation/test/Dockerfile-megalinter-custom

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ FROM hadolint/hadolint:${DOCKERFILE_HADOLINT_VERSION} AS hadolint
3333
# Build wheel for megalinter python package
3434
##################
3535
FROM ghcr.io/astral-sh/uv:0.7.22 AS uv
36-
FROM python:3.13-alpine3.21 AS build-ml-core
36+
FROM python:3.13-alpine3.22 AS build-ml-core
3737
WORKDIR /
3838
COPY --from=uv /uv /uvx /bin/
3939
# Install dependencies
@@ -50,7 +50,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
5050
##################
5151
# Get base image #
5252
##################
53-
FROM python:3.13-alpine3.21
53+
FROM python:3.13-alpine3.22
5454

5555
#############################################################################################
5656
## @generated by .automation/build.py using descriptor files, please do not update manually ##

.github/workflows/deploy-DEV.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ jobs:
175175
fi
176176
docker image ls
177177
docker run $CI_ENV -e TEST_CASE_RUN=true -e OUTPUT_FORMAT=text -e OUTPUT_FOLDER=${{ github.sha }} -e OUTPUT_DETAIL=detailed -e GITHUB_SHA=${{ github.sha }} -e GITHUB_REPOSITORY=${GITHUB_REPOSITORY} -e GITHUB_BRANCH=${GITHUB_BRANCH} -e GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" -e TEST_KEYWORDS="${TEST_KEYWORDS_TO_USE}" -e MEGALINTER_VOLUME_ROOT="${GITHUB_WORKSPACE}" -v "/var/run/docker.sock:/var/run/docker.sock:rw" -v ${GITHUB_WORKSPACE}:/tmp/lint ${{ fromJson(steps.meta.outputs.json).tags[0]}}
178-
timeout-minutes: 90
178+
timeout-minutes: 120
179179
env:
180180
COMMIT_MSG: ${{ github.event.head_commit.message }}
181181

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
2020
- Use ghcr.io docker images by default because of rate limits on docker.io
2121
- Use uv to create the venv folder for pip-installed linters
2222
- Add copilot instructions for GitHub Copilot
23+
- Update base image to python:3.13-alpine3.21 (also embeds go 1.24)
2324

2425
- New linters
2526

2627
- Disabled linters
28+
- [puppet-lint](https://megalinter.io/beta/descriptors/puppet_puppet_lint/): Disabled Until fix is provided for <https://github.com/puppetlabs/puppet-lint/issues/251>
29+
- [checkov](https://megalinter.io/beta/descriptors/repository_checkov/): Disabled until fix is provided for <https://github.com/bridgecrewio/checkov/issues/7263>
2730

2831
- Removed linters
2932
- **markdown-link-check** has been removed because [**lychee**](https://megalinter.io/latest/descriptors/spell_lychee/) can be used instead, and has much better performances

Dockerfile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ FROM alpine/terragrunt:${TERRAFORM_TERRAGRUNT_VERSION} AS terragrunt
8787
# Build wheel for megalinter python package
8888
##################
8989
FROM ghcr.io/astral-sh/uv:0.8.17 AS uv
90-
FROM python:3.13-alpine3.21 AS build-ml-core
90+
FROM python:3.13-alpine3.22 AS build-ml-core
9191
WORKDIR /
9292
COPY --from=uv /uv /uvx /bin/
9393
# Install dependencies
@@ -104,7 +104,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
104104
##################
105105
# Get base image #
106106
##################
107-
FROM python:3.13-alpine3.21
107+
FROM python:3.13-alpine3.22
108108

109109
#############################################################################################
110110
## @generated by .automation/build.py using descriptor files, please do not update manually ##
@@ -266,8 +266,6 @@ ARG PHP_FRIENDSOFPHP_PHP_CS_FIXER_VERSION=v3.87.2
266266
# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/
267267
ARG PSSA_VERSION='1.24.0'
268268

269-
# renovate: datasource=rubygems depName=puppet-lint
270-
ARG GEM_PUPPET_LINT_VERSION=4.3.0
271269
# renovate: datasource=pypi depName=pylint
272270
ARG PIP_PYLINT_VERSION=3.3.8
273271
# renovate: datasource=pypi depName=typing-extensions
@@ -292,8 +290,6 @@ ARG PIP_RUFF_VERSION=0.13.0
292290
ARG RAKU_RAKU_VERSION=2024.12
293291
ARG RAKU_RAKU_ALPINE_VERSION=3.20
294292

295-
# renovate: datasource=pypi depName=checkov
296-
ARG PIP_CHECKOV_VERSION=3.2.413
297293
# renovate: datasource=nuget depName=Microsoft.CST.DevSkim.CLI
298294
ARG REPOSITORY_DEVSKIM_VERSION=1.0.63
299295
# renovate: datasource=github-tags depName=anchore/grype
@@ -437,7 +433,7 @@ RUN apk -U --no-cache upgrade \
437433
coreutils \
438434
py3-pyflakes \
439435
cppcheck \
440-
clang19-extra-tools \
436+
clang20-extra-tools \
441437
openjdk17 \
442438
helm \
443439
gcompat \
@@ -508,7 +504,6 @@ RUN uv pip install --system --no-cache pip==${PIP_PIP_VERSION} virtualenv==${PIP
508504
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/mypy" && VIRTUAL_ENV="/venvs/mypy" uv pip install --no-cache mypy==${PIP_MYPY_VERSION} \
509505
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/ruff" && VIRTUAL_ENV="/venvs/ruff" uv pip install --no-cache ruff==${PIP_RUFF_VERSION} \
510506
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/ruff-format" && VIRTUAL_ENV="/venvs/ruff-format" uv pip install --no-cache ruff==${PIP_RUFF_VERSION} \
511-
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/checkov" && VIRTUAL_ENV="/venvs/checkov" uv pip install --no-cache checkov==${PIP_CHECKOV_VERSION} \
512507
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/semgrep" && VIRTUAL_ENV="/venvs/semgrep" uv pip install --no-cache semgrep==${PIP_SEMGREP_VERSION} \
513508
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/rst-lint" && VIRTUAL_ENV="/venvs/rst-lint" uv pip install --no-cache Pygments==${PIP_PYGMENTS_VERSION} restructuredtext_lint==${PIP_RESTRUCTUREDTEXT_LINT_VERSION} \
514509
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/rstcheck" && VIRTUAL_ENV="/venvs/rstcheck" uv pip install --no-cache click==${PIP_RSTCHECK_CLICK_VERSION} rstcheck[toml,sphinx]==${PIP_RSTCHECK_VERSION} \
@@ -520,7 +515,7 @@ RUN uv pip install --system --no-cache pip==${PIP_PIP_VERSION} virtualenv==${PIP
520515
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/yamllint" && VIRTUAL_ENV="/venvs/yamllint" uv pip install --no-cache yamllint==${PIP_YAMLLINT_VERSION} \
521516
&& find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \
522517
&& rm -rf /root/.cache
523-
ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/cfn-lint/bin:/venvs/stylelint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/bandit/bin:/venvs/mypy/bin:/venvs/ruff/bin:/venvs/ruff-format/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
518+
ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/cfn-lint/bin:/venvs/stylelint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/bandit/bin:/venvs/mypy/bin:/venvs/ruff/bin:/venvs/ruff-format/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
524519
#PIPVENV__END
525520

526521
############################
@@ -605,7 +600,6 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \
605600
#GEM__START
606601
RUN echo 'gem: --no-document' >> ~/.gemrc && \
607602
gem install \
608-
puppet-lint:${GEM_PUPPET_LINT_VERSION} \
609603
rubocop:${GEM_RUBOCOP_VERSION} \
610604
rubocop-github:${GEM_RUBOCOP_GITHUB_VERSION} \
611605
rubocop-performance:${GEM_RUBOCOP_PERFORMANCE_VERSION} \
@@ -1015,8 +1009,6 @@ RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSI
10151009
# protolint installation
10161010
# Managed with COPY --link --from=protolint /usr/local/bin/protolint /usr/bin/
10171011
#
1018-
# puppet-lint installation
1019-
#
10201012
# pylint installation
10211013
#
10221014
# black installation
@@ -1049,8 +1041,6 @@ RUN mkdir -p /home/r-library \
10491041

10501042
ENV PATH="~/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$PATH"
10511043
#
1052-
# checkov installation
1053-
#
10541044
# devskim installation
10551045
# Next line commented because already managed by another linter
10561046
# RUN apk add --no-cache dotnet9-sdk

Dockerfile-custom-flavor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ FROM ghcr.io/astral-sh/uv:0.8.17 AS uv
1010
##################
1111
# Get base image #
1212
##################
13-
FROM python:3.13-alpine3.21
13+
FROM python:3.13-alpine3.22
1414

1515
RUN apk -U --no-cache upgrade \
1616
&& apk add --no-cache \

Dockerfile-quick

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ FROM $MEGALINTER_BASE_IMAGE as base
1616
# Build wheel for megalinter python package
1717
##################
1818
FROM ghcr.io/astral-sh/uv:0.8.17 AS uv
19-
FROM python:3.13-alpine3.21 AS build-ml-core
19+
FROM python:3.13-alpine3.22 AS build-ml-core
2020
WORKDIR /
2121
COPY pyproject.toml .
2222
COPY --from=uv /uv /bin/uv

flavors/c_cpp/Dockerfile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ FROM lycheeverse/lychee:${SPELL_LYCHEE_VERSION} AS lychee
6060
# Build wheel for megalinter python package
6161
##################
6262
FROM ghcr.io/astral-sh/uv:0.8.17 AS uv
63-
FROM python:3.13-alpine3.21 AS build-ml-core
63+
FROM python:3.13-alpine3.22 AS build-ml-core
6464
WORKDIR /
6565
COPY --from=uv /uv /uvx /bin/
6666
# Install dependencies
@@ -77,7 +77,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
7777
##################
7878
# Get base image #
7979
##################
80-
FROM python:3.13-alpine3.21
80+
FROM python:3.13-alpine3.22
8181

8282
#############################################################################################
8383
## @generated by .automation/build.py using descriptor files, please do not update manually ##
@@ -133,8 +133,6 @@ ARG KUBERNETES_KUBESCAPE_VERSION=3.0.40
133133
ARG NPM_MARKDOWNLINT_CLI_VERSION=0.45.0
134134
# renovate: datasource=npm depName=markdown-table-formatter
135135
ARG NPM_MARKDOWN_TABLE_FORMATTER_VERSION=1.6.1
136-
# renovate: datasource=pypi depName=checkov
137-
ARG PIP_CHECKOV_VERSION=3.2.413
138136
# renovate: datasource=github-tags depName=anchore/grype
139137
ARG REPOSITORY_GRYPE_VERSION=0.99.1
140138
# renovate: datasource=npm depName=@ls-lint/ls-lint
@@ -213,7 +211,7 @@ RUN apk -U --no-cache upgrade \
213211
openjdk21 \
214212
py3-pyflakes \
215213
cppcheck \
216-
clang19-extra-tools \
214+
clang20-extra-tools \
217215
openjdk17 \
218216
helm \
219217
gcompat \
@@ -264,7 +262,6 @@ RUN uv pip install --system --no-cache pip==${PIP_PIP_VERSION} virtualenv==${PIP
264262
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/cpplint" && VIRTUAL_ENV="/venvs/cpplint" uv pip install --no-cache cpplint==${PIP_CPPLINT_VERSION} \
265263
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/stylelint" && VIRTUAL_ENV="/venvs/stylelint" uv pip install --no-cache cpplint==${PIP_CPPLINT_VERSION} \
266264
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/djlint" && VIRTUAL_ENV="/venvs/djlint" uv pip install --no-cache djlint==${PIP_DJLINT_VERSION} \
267-
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/checkov" && VIRTUAL_ENV="/venvs/checkov" uv pip install --no-cache checkov==${PIP_CHECKOV_VERSION} \
268265
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/semgrep" && VIRTUAL_ENV="/venvs/semgrep" uv pip install --no-cache semgrep==${PIP_SEMGREP_VERSION} \
269266
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/snakemake" && VIRTUAL_ENV="/venvs/snakemake" uv pip install --no-cache snakemake==${PIP_SNAKEMAKE_VERSION} \
270267
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/snakefmt" && VIRTUAL_ENV="/venvs/snakefmt" uv pip install --no-cache snakefmt==${PIP_SNAKEFMT_VERSION} \
@@ -273,7 +270,7 @@ RUN uv pip install --system --no-cache pip==${PIP_PIP_VERSION} virtualenv==${PIP
273270
&& uv venv --seed --no-project --no-managed-python --no-cache "/venvs/yamllint" && VIRTUAL_ENV="/venvs/yamllint" uv pip install --no-cache yamllint==${PIP_YAMLLINT_VERSION} \
274271
&& find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \
275272
&& rm -rf /root/.cache
276-
ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/stylelint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin
273+
ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/stylelint/bin:/venvs/djlint/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin
277274
#PIPVENV__END
278275

279276
############################
@@ -445,8 +442,6 @@ RUN curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/rel
445442
# protolint installation
446443
# Managed with COPY --link --from=protolint /usr/local/bin/protolint /usr/bin/
447444
#
448-
# checkov installation
449-
#
450445
# gitleaks installation
451446
# Managed with COPY --link --from=gitleaks /usr/bin/gitleaks /usr/bin/
452447
#

flavors/c_cpp/flavor.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"MARKDOWN_MARKDOWNLINT",
3939
"MARKDOWN_MARKDOWN_TABLE_FORMATTER",
4040
"PROTOBUF_PROTOLINT",
41-
"REPOSITORY_CHECKOV",
4241
"REPOSITORY_GIT_DIFF",
4342
"REPOSITORY_GITLEAKS",
4443
"REPOSITORY_GRYPE",

flavors/ci_light/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ FROM trufflesecurity/trufflehog:${REPOSITORY_TRUFFLEHOG_VERSION} AS trufflehog
3939
# Build wheel for megalinter python package
4040
##################
4141
FROM ghcr.io/astral-sh/uv:0.8.17 AS uv
42-
FROM python:3.13-alpine3.21 AS build-ml-core
42+
FROM python:3.13-alpine3.22 AS build-ml-core
4343
WORKDIR /
4444
COPY --from=uv /uv /uvx /bin/
4545
# Install dependencies
@@ -56,7 +56,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
5656
##################
5757
# Get base image #
5858
##################
59-
FROM python:3.13-alpine3.21
59+
FROM python:3.13-alpine3.22
6060

6161
#############################################################################################
6262
## @generated by .automation/build.py using descriptor files, please do not update manually ##

0 commit comments

Comments
 (0)