feat: add Dockerfile validation to pre-commit hooks

Added custom Dockerfile validation script that detects mismatches between
base image OS (Debian vs Alpine) and package managers (apt vs apk).

This will catch errors like:
- Using golang:latest (Debian) with apk commands
- Using alpine images with apt commands

The hook runs automatically on commit and would have caught the recent
golang:latest + apk mismatch that caused Docker build failures.
This commit is contained in:
Wikid82
2025-11-18 15:54:56 -05:00
parent 08db82d92a
commit 3401757a10
2 changed files with 66 additions and 0 deletions

View File

@@ -27,3 +27,11 @@ repos:
exclude: '^(frontend/(coverage|dist|node_modules|\.vite)/|.*\.tsbuildinfo$)'
- id: check-yaml
- id: check-added-large-files
- repo: local
hooks:
- id: dockerfile-check
name: dockerfile validation
entry: tools/dockerfile_check.sh
language: script
files: "Dockerfile.*"
pass_filenames: true