Goal and Scope
This tutorial uses one new example to show how five Skills fit into a practical workflow: docker-best-practices, dockerfile-optimise, containerization, docker, and docker-ops-toolkit. A Skill here means guidance, command references, templates, or bundled scripts for an Agent. It does not mean that anything was installed, tested, or authorized. Kubernetes manifests and cluster scheduling remain outside this selection.
Imagine an internal reporting service with a Python application, a lockfile, a build step that generates static assets, runtime configuration, and SQLite data. The reported problems are a large image, a source edit that rebuilds dependency layers, and a Compose service whose web page is unreachable. The workflow below moves from advice to validation, then to controlled execution.
Step 1: Review the Dockerfile with Guides
Give the Agent a redacted Dockerfile, the slowest build steps, a layer-size overview, and the current .dockerignore. Start with docker-best-practices for structure, then use dockerfile-optimise for caching and build-context questions. Ask for itemized recommendations only: no file edits and no builds at this stage.
For this example, ask whether dependency manifests are copied and installed before application source, whether build tools leak into the runtime image, whether local artifacts are excluded from the build context, whether the base image is appropriate, and whether a multi-stage build separates generation from runtime. Each suggestion should explain expected effects and possible dependency risks. Avoid promising a fixed percentage of improvement.
A reasonable draft would copy manifests and the lockfile first, install dependencies, copy source later, generate assets in a build stage, and retain only runtime needs in the final stage. Add ignore rules and verify that the runtime user can read configuration and write only where required. Keep the old Dockerfile and base image version as a rollback baseline.
Step 2: Containerization and Supply-Chain Checks
Use containerization when turning the application into an image or preparing release work. Provide the runtime version, dependencies, startup command, listening port, persistent data path, and whether compilers are needed. The Skill supplies guidance and templates for base images, non-root execution, digest pinning, and Trivy checks. It does not build images or run scans.
For the example, verify that no development secrets are copied into layers, that the SQLite path is on a deliberate volume or can be safely recreated, that the process listens on an appropriate interface, and that the base image digest is recorded. Prepare Trivy and authorization separately. A clean scan only covers the scan performed; it is not security certification. Image pushes and production changes still require explicit approval.
Step 3: Troubleshoot Compose in a Fixed Order
For a running container with an unreachable page, use docker command references to narrow the cause before deleting volumes or recreating the stack. Share only the redacted Compose file, service names, port mappings, environment variable names, logs, health checks, and exit codes.
Check whether the application finished starting, read recent logs, compare the container listening port with the published mapping, inspect dependency readiness, and verify that the health check matches real startup behavior. Also confirm network and volume targets. A live process does not prove the web service is ready.
If many services need log or health review, inspect the current scripts in docker-ops-toolkit before authorizing them. Those scripts can affect the real environment, so verify the Docker context, selected services, and permissions.
Step 4: Execute, Clean Up, and Accept Results
Run the revised Dockerfile only in an authorized test environment with working Docker and Compose access. Compare a clean build and an incremental build. Record build time, image size, cache invalidation after a dependency change, startup behavior, and data access. If runtime dependencies were removed, revise the draft instead of promoting it.
Before cleanup, identify space used by images, build cache, logs, and volumes. Review the actual docker-ops-toolkit script and any preview output available in that version; do not assume a specific flag exists. Aggressive cleanup, prune, volume deletion, and compose down with volume removal can destroy data. The SQLite volume matters even when no running container currently references it. Back it up and confirm each deletion target.
Keep acceptance records in three groups: build and size evidence, runtime and log evidence, and supply-chain review evidence. Guides do not execute work, download counts do not prove results, and scripts are not reusable production plans by default. Without a known context, explicit permission, and a recovery path, remain at the recommendation or preview stage.