Docker build
Build Docker images with proper tagging, cache busting, and build tracking. Prevents stale image issues.From its SKILL.md
npx -y skills add TheLobbi/claude --skill docker-buildAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 21 stars21 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.5 KB, as published. Nobody here has run it
Docker Build with Tracking
Build a Docker image with proper tagging and tracking: $ARGUMENTS
Process
-
Determine the image tag - Use git SHA or timestamp, NEVER use
:latestaloneGIT_SHA=$(git rev-parse --short HEAD) TIMESTAMP=$(date +%Y%m%d-%H%M%S) TAG="${GIT_SHA}-${TIMESTAMP}" -
Build with cache busting when needed
- For production builds:
docker build --no-cache --pull -t <registry>/<image>:${TAG} . - For dev builds:
docker build -t <registry>/<image>:${TAG} . - Always also tag as
:<branch>-latestfor convenience
- For production builds:
-
Verify the build
docker images | grep <image> docker inspect <registry>/<image>:${TAG} | jq '.[0].Created' -
Push to registry
docker push <registry>/<image>:${TAG} docker push <registry>/<image>:<branch>-latest -
Verify in registry
# For ACR: az acr repository show-tags --name <registry> --repository <image> --orderby time_desc --top 5 # For Docker Hub: docker manifest inspect <registry>/<image>:${TAG}
Anti-Patterns (DO NOT)
- Never build with just
:latesttag - Never skip pushing after building
- Never deploy without verifying the image exists in the registry
- Never use
imagePullPolicy: IfNotPresentwith mutable tags