Prefer apt-get over apt
LOWUse apt-get instead of apt for better script stability in Dockerfiles.
Use apt-get instead of apt for better script stability in Dockerfiles.
Experiment with the vulnerable code and security rule below. Edit the code to see how the rule detects different vulnerability patterns.
pathfinder ci --ruleset docker/DOCKER-BP-023 --project .Explore related security rules for Docker
apt-get install without --no-install-recommends. This installs unnecessary packages, increasing image size and attack surface.
Avoid 'apk upgrade' in Dockerfiles. Use specific base image versions instead for reproducible builds.
Avoid apt-get upgrade in Dockerfiles. Use specific base image versions instead.
Common questions about Prefer apt-get over apt
Use Code Pathfinder to scan your Docker codebase and automatically detect instances of this vulnerability pattern. Install Code Pathfinder and run the following command in your project directory:
pathfinder ci --ruleset docker/DOCKER-BP-023 --project .This rule is aligned with industry-standard security frameworks and classifications:
New feature
The Prefer apt-get over apt rule runs in CI and posts inline review comments on the exact lines — no dashboard, no SARIF viewer.