Docker hadolint

From TheBeardedBearSAS/claude-craft · View interactive version

Docker hadolint is an AI agent skill from the GitHub repository TheBeardedBearSAS/claude-craft. Docker & Hadolint validation (2026). Use when working with Docker, containers, or validating Dockerfiles.

How to use this skill

Skill file

Docker & Hadolint (2026)

Versions (octobre 2026)

Source : https://docs.docker.com/engine/release-notes/29/

Source : https://github.com/docker/compose/releases

Source : https://github.com/hadolint/hadolint/releases/tag/v2.15.1

Validation Hadolint

TOUJOURS utiliser la version pinnée v2.15.1 (jamais latest ou sans tag).

# Validation Dockerfile
docker run --rm -i hadolint/hadolint:v2.15.1 < Dockerfile

# Validation via Makefile (recommandé)
make hadolint

Best Practices 2026

BuildKit Cache Mounts

RUN --mount=type=cache,target=/var/cache/apk \
    apk add --no-cache postgresql-dev

Bénéfice : Réduction temps build de 40-60%

Source : https://docs.docker.com/build/cache/

BuildKit Secrets

RUN --mount=type=secret,id=composer_token \
    COMPOSER_AUTH="$(cat /run/secrets/composer_token)" composer install

Bénéfice : Aucun secret dans l'image finale

Source : https://docs.docker.com/build/building/secrets/

Multi-Stage Builds

FROM php:8.4-fpm-alpine AS builder
RUN composer install

FROM php:8.4-fpm-alpine AS runtime
COPY --from=builder /app /app

Bénéfice : Réduction taille image de 60-97%

Source : https://docs.docker.com/build/building/multi-stage/

Images Distroless

FROM gcr.io/distroless/php8.4-fpm
COPY --from=builder /app /app

Bénéfice : Surface d'attaque minimale, CVE réduites de 90%

Source : https://github.com/GoogleContainerTools/distroless

Documentation Complète

Voir @.claude/references/symfony/docker.md pour architecture complète et exemples.

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.