super-linter / super-linter

Combination of multiple linters to run as a GitHub Action or standalone
https://github.com/super-linter/super-linter
MIT License
9.55k stars 974 forks source link

Cannot delete file in volume after running super-linter locally #6280

Closed Zrmikstri closed 1 month ago

Zrmikstri commented 1 month ago

Is there an existing issue for this?

Are you using the latest Super-linter version available?

Are you resonably sure that it's a Super-linter issue, and not an issue related to a tool that Super-linter runs?

Current Behavior

I'm running super-linter locally and cannot clean up the temporary code base after the container finished running.

Expected Behavior

The code base folder provided when binding volume with -v should be easily delete with rm -r.

Super-Linter version

Latest

Super-linter configuration

No config

Relevant log output

rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-GIT_MERGE_CONFLICT_MARKERS': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-GITLEAKS': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-PYTHON_BLACK': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-PYTHON_FLAKE8': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-PYTHON_ISORT': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-PYTHON_PYLINT': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-PYTHON_MYPY': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-PYTHON_PYINK': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-PYTHON_RUFF': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-CHECKOV': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-JSCPD': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-file-arrays/file-array-GIT_COMMITLINT': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-parallel-results-build-file-list.json': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-results.json': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-worker-results-PYTHON_RUFF.json': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-parallel-command-exit-code-PYTHON_RUFF': Permission denied
rm: cannot remove 'temp/super-linter-output/super-linter/super-linter-parallel-stdout-PYTHON_RUFF': Permission denied
rm: cannot remove 'temp/.ruff_cache/0.6.2/6157233011509601146': Permission denied
rm: cannot remove 'temp/.ruff_cache/CACHEDIR.TAG': Permission denied
rm: cannot remove 'temp/.ruff_cache/.gitignore': Permission denied

Steps To Reproduce

  1. Running this command with Fedora 40, Docker version 27.3.1, build ce12230
    docker run \
    -e LOG_LEVEL=INFO \
    -e RUN_LOCAL=true \
    -e USE_FIND_ALGORITHM=true \
    -e VALIDATE_PYTHON_RUFF=true \
    -e PYTHON_RUFF_CONFIG_FILE=python-default.toml \
    -e SAVE_SUPER_LINTER_OUTPUT=true \
    -v temp:/tmp/lint \
    --rm \
    ghcr.io/super-linter/super-linter:latest
  2. Then remove temp with
    rm -r temp

    or with -f

    rm -rf temp

Anything else?

No response

ferrarimarco commented 1 month ago

Hi! This is expected because Super-linter currently runs as root. There's a proposal to configure a non-root user already: #5658

Closing this as duplicate of that one.

Thanks for taking the time to report this!