Skip to content
Back to skills

Build And Scan Container Image

ASecurity

Use when building, validating, scanning, or generating an SBOM for a container image. Checks Dockerfile safety, base images, secrets, non-root execution, vulnerabilities, reproducibility, and immutable tagging.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 17, 2026
ai-agentsdocker

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add ByronScottJones/Agents --skill build-and-scan-container-image --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Build And Scan Container Image?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Build And Scan Container Image
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/byronscottjones-build-and-scan-container-image/badge)](https://www.skillsdirectory.com/skills/byronscottjones-build-and-scan-container-image)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: build-and-scan-container-image
user-invocable: false
description: "Use when building, validating, scanning, or generating an SBOM for a container image. Checks Dockerfile safety, base images, secrets, non-root execution, vulnerabilities, reproducibility, and immutable tagging."
---

# Build and Scan Container Image

Implement `containers.md` as a build-and-release gate.

## Parameters

- `dockerfilePath`: default `Dockerfile`.
- `contextPath`: default directory containing the Dockerfile.
- `image`: optional image tag.
- `registry`: optional push target.
- `scan`: default `true`.
- `sbom`: default `true`.
- `maxSeverity`: default `high`.
- `push`: default `false`.
- `format`: `summary`, `json`, or `sarif`; default `summary`.

## Workflow

1. Parse the Dockerfile and inspect `.dockerignore` and build context.
2. Check base-image support, multi-stage builds, secret leakage, user identity,
   ports, health checks, and reproducible dependency inputs.
3. Build without pushing unless explicitly requested.
4. Scan the resulting image with the configured scanner and generate an SBOM.
5. Verify runtime user, exposed capabilities, and immutable digest.
6. Push only after explicit confirmation and a passing policy gate.

## Safety

- Never place secrets in Dockerfiles, layers, arguments, or labels.
- Never push `latest` as the only release identifier.
- Default to no registry mutation.
- Report scanner limitations and unavailable checks.

## Output

Return image identity, Dockerfile findings, vulnerability counts, SBOM path,
non-root and runtime checks, digest, push status, and blockers.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.