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

mega-linter-runner: Remove container by default, except of no-remove-container option is sent #3203

Merged
merged 1 commit into from
Dec 10, 2023

Conversation

nvuillam
Copy link
Member

Fixes #3062

Copy link
Contributor

github-actions bot commented Dec 10, 2023

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ BASH bash-exec 5 0 0.01s
✅ BASH shellcheck 5 0 0.09s
✅ BASH shfmt 5 0 0 0.33s
✅ COPYPASTE jscpd yes no 5.08s
✅ DOCKERFILE hadolint 127 0 12.13s
✅ JSON eslint-plugin-jsonc 23 0 0 3.77s
✅ JSON jsonlint 21 0 0.25s
✅ JSON v8r 23 0 19.97s
✅ MAKEFILE checkmake 1 0 0.01s
⚠️ MARKDOWN markdownlint 259 0 265 29.72s
✅ MARKDOWN markdown-link-check 259 0 8.59s
✅ MARKDOWN markdown-table-formatter 259 0 0 68.19s
✅ OPENAPI spectral 1 0 1.8s
⚠️ PYTHON bandit 206 59 2.87s
✅ PYTHON black 206 0 0 4.46s
✅ PYTHON flake8 206 0 3.63s
✅ PYTHON isort 206 0 0 0.99s
✅ PYTHON mypy 206 0 16.36s
✅ PYTHON pylint 206 0 19.88s
⚠️ PYTHON pyright 206 346 26.4s
✅ PYTHON ruff 206 0 0 0.39s
✅ REPOSITORY checkov yes no 39.06s
✅ REPOSITORY git_diff yes no 0.33s
⚠️ REPOSITORY grype yes 1 21.56s
✅ REPOSITORY secretlint yes no 12.76s
✅ REPOSITORY trivy yes no 32.37s
✅ REPOSITORY trivy-sbom yes no 22.02s
⚠️ REPOSITORY trufflehog yes 1 18.68s
✅ SPELL cspell 679 0 31.04s
✅ SPELL lychee 339 0 7.64s
✅ XML xmllint 3 0 0 0.32s
✅ YAML prettier 160 0 0 6.55s
✅ YAML v8r 102 0 159.49s
✅ YAML yamllint 161 0 2.22s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@nvuillam nvuillam merged commit 549aa8a into main Dec 10, 2023
130 checks passed
@nvuillam nvuillam deleted the fixes/runner-container branch December 10, 2023 19:31
description: "Remove MegaLinter Docker container when done (default: true since v7.8.0)",
},
{
option: "no-remove-container",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nvuillam should this new option be set to be mutually exclusive like other sets below?

And shouldn’t release be mutually exclusive with image (you can’t add a tag to an already full name)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@echoix indeed you are right :)

@huczas
Copy link

huczas commented Feb 5, 2024

I have latest version 7.8.0, this feature is already merged but I'm not sure if it is working as expected?
I have worker image with preinstalled docker img megalinter (and many other stuff), it is used many times during day, should I add this "no-remove-container"?
For now nothing is deleted and docker container is not removed automatically from my workers - which is best for my case.

@echoix
Copy link
Collaborator

echoix commented Feb 6, 2024

Removing the container is not the same thing as removing the image. The image pulled shouldn't be removed. Only the container started from that image.

This will show you the containers on your system, including the ones that are stopped. Stopped containers can be restarted, like when you boot a machine a second time.

docker ps --all

Usually, you'd probably want to have a new container from the same image, so that for one, it is clean, and that you can use different startup parameters (like env vars). Since you probably don't write the command manually, mega-linter-runner does, it shouldn't bother to remove the container after use. It is the equivalent of using the --rm in

docker run --rm ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mega-linter-runner should use --remove-container by default
3 participants