- Home
- Skills
- DevOps & Cloud
- Dockerfile Safety Check
More screenshots
Works with the AI Agents you already use
Dockerfile Safety Check
Catch Dockerfile mistakes before you build or push: secrets baked into ENV or ARG, curl-pipe-to-shell downloads, copied .env files and keys, root containers and unpinned base images.
$5
Dockerfile Safety Check
Example session with this skill installed
Check this project with dockerfile-safety-check.
- Read your context and instructions
- Compiled the dockerfile safety check
$ python3 scripts/check_dockerfile.py examples/risky
BLOCK Dockerfile:3 D01 SECRET_IN_ENV_OR_ARG
ARG NPM_TOKEN=<redacted, 22 chars>
Why: A password, token or key is written into ENV or ARG. It is stored in the image layers and build history, so anyone who can pull the image can read it.
Safer: Pass secrets at run time (environment or a secret store), or use BuildKit RUN --mount=type=secret for build-time secrets.
BLOCK Dockerfile:4 D03 SECRET_FILE_COPIED
BLOCK Dockerfile:5 D02 PIPE_TO_SHELL
REVIEW Dockerfile:1 D12 UNPINNED_BASE_IMAGE
REVIEW Dockerfile:6 D14 APT_CACHE_LEFT
REVIEW Dockerfile:7 D16 SUDO_IN_BUILD
REVIEW Dockerfile:8 D13 ADD_FROM_URL
REVIEW Dockerfile:9 D17 WORLD_WRITABLE
REVIEW Dockerfile:12 D11 RUNS_AS_ROOT
REVIEW Dockerfile:12 D12 UNPINNED_BASE_IMAGE
REVIEW Dockerfile:14 D15 NO_HEALTHCHECK
(Each finding also has Why and Safer lines, as in the first one.)
Verdict: BLOCK. Checked 1 file, 1 with Dockerfile content.
This is a static check of file text. NOT FLAGGED is not a guarantee.
Connects securely to your tools. The creator never sees your data.
About this skill
A secret written into ENV or ARG stays in every image layer and in the build history, so anyone who can pull the image can read it. This skill finds that and nine other common Dockerfile mistakes, and tells you how to fix each one.
Your agent runs a scanner on your Dockerfiles (Dockerfile, Dockerfile.*, *.dockerfile, Containerfile). It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach for every finding. Multi-stage builds are understood: the root user and health checks are judged on the final stage. Secret values are never printed: the report shows the variable name and length only.
What it checks
BLOCK
- D01: a password, token or key written into ENV or ARG
- D02: a script piped from curl or wget straight into a shell
- D03: a .env file, an SSH or TLS private key, or a .p12/.pfx bundle copied into the image
REVIEW
- D11: the final image runs as root
- D12: a base image with no tag or :latest
- D13: ADD of a remote URL with no checksum
- D14: apt-get install without removing the package lists
- D15: an exposed port with no HEALTHCHECK
- D16: sudo in a build step
- D17: chmod 777
What's included
- The scanner (Python 3.9+, standard library only)
- A rules guide with the reason and safer approach for each rule
- A risky and a safe example Dockerfile, and the real report the scanner produces on the risky one
Limits It is a static check of the Dockerfile text. It does not build images or read build arguments, and it supports the default backslash line continuation only. NOT FLAGGED is not a guarantee.
Static check of Dockerfile text only. Values from build arguments or included files are not seen. A custom # escape= directive is not supported. NOT FLAGGED is not a guarantee.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
Requires
Permissions
Runs one local Python script in the terminal. It reads your project's files, writes nothing, and makes no network calls.