Docker build

From markus41/claude · View interactive version

Docker build is an AI agent skill from the GitHub repository markus41/claude. Build Docker images with proper tagging, cache busting, and build tracking. Prevents stale image issues.

How to use this skill

Skill file

Docker Build with Tracking

Build a Docker image with proper tagging and tracking: $ARGUMENTS

Process

  1. Determine the image tag - Use git SHA or timestamp, NEVER use :latest alone

```bash

GIT_SHA=$(git rev-parse --short HEAD)

TIMESTAMP=$(date +%Y%m%d-%H%M%S)

TAG="${GIT_SHA}-${TIMESTAMP}"

```

  1. Build with cache busting when needed
  1. Verify the build

```bash

docker images | grep <image>

docker inspect <registry>/<image>:${TAG} | jq '.[0].Created'

```

  1. Push to registry

```bash

docker push <registry>/<image>:${TAG}

docker push <registry>/<image>:<branch>-latest

```

  1. Verify in registry

```bash

# 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)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.