- Add 60 new agents across all 10 categories (75 -> 135) - Add 95 new plugins with command files (25 -> 120) - Update all agents to use model: opus - Update README with complete plugin/agent tables - Update marketplace.json with all 120 plugins
1.5 KiB
1.5 KiB
Build a Docker image with best practices for caching, security, and size optimization.
Steps
- Read the existing Dockerfile or generate one if missing.
- Analyze the build context:
- Check
.dockerignoreexists and excludes unnecessary files. - Identify the base image and its size.
- Map build stages and layer count.
- Check
- Build the image with build arguments:
docker build -t <name>:<tag> --build-arg VERSION=<ver> .- Use BuildKit for improved caching:
DOCKER_BUILDKIT=1. - Add
--platform linux/amd64,linux/arm64for multi-arch if needed.
- Verify the build:
- Check final image size:
docker images <name>:<tag>. - Run a quick smoke test:
docker run --rm <name>:<tag> <health-command>. - Scan for vulnerabilities:
docker scout cves <name>:<tag>.
- Check final image size:
- Tag appropriately:
<name>:latestfor development.<name>:<version>for releases.<name>:<git-sha-short>for CI builds.
- Report build results and image details.
Format
Docker Build: <name>:<tag>
Base: <base-image>
Size: <size>MB (layers: <N>)
Build time: <duration>
Vulnerabilities: <C>critical, <H>high, <M>medium
Smoke test: <pass/fail>
Push: docker push <registry>/<name>:<tag>
Rules
- Always use specific base image tags, not
latest. - Include a
.dockerignoreto minimize build context. - Run as non-root user in the final image.
- Use multi-stage builds to keep the final image minimal.
- Add health check instruction (
HEALTHCHECK) for production images.