mcpField
D
docker-hadolint

docker-hadolint

github.com/thebeardedbearsasCloud & DevOps107205 installsUpdated today
Repository

About docker-hadolint

A project skill for writing and checking Dockerfiles with Hadolint, aimed at developers maintaining Docker images. It specifies a pinned Hadolint version and documents BuildKit and image-building practices.

Key features

  1. 01Pinned Hadolint v2.15.1 validation
  2. 02Dockerfile checks via Docker or Makefile
  3. 03BuildKit cache mount guidance
  4. 04BuildKit secret handling guidance
  5. 05Multi-stage and distroless image guidance

Use cases

  1. 01Validate a Dockerfile with Hadolint
  2. 02Apply cache mounts to image builds
  3. 03Keep build secrets out of final images
  4. 04Separate build and runtime image stages

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/thebeardedbearsas/claude-craft --skill docker-hadolint

After installing, type/docker-hadolintin Claude Code to confirm it loaded.

Details

From the project README

Docker & Hadolint (2026)

Versions (octobre 2026)

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.

Comments

Markdown supported