Rules Hub
Coding Rules Library
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Locally build and run a Docker image before merging Dockerfile changes
After changing a Dockerfile, build and run the image locally before merging — don't rely solely on CI to catch build breakage.
Bad example
| 1 | # Dockerfile edited, PR opened relying on CI's docker build step to validate |
Explanation (EN)
CI catches build failures late in the review cycle and burns CI minutes; a local `docker build && docker run` gives faster feedback and lets you verify the running container, not just that it built.
Objašnjenje (HR)
CI hvata neuspjehe gradnje kasno u ciklusu pregleda i trosi CI minute; lokalni `docker build && docker run` daje brzu povratnu informaciju i omogucuje provjeru kontejnera koji se pokrece, ne samo da se izgradio.
Good example
| 1 | docker build -t app:test . && docker run --rm app:test |
Explanation (EN)
Building and running locally before pushing catches missing COPY paths, broken multi-stage references, and runtime failures before they reach review or CI.
Objašnjenje (HR)
Lokalna gradnja i pokretanje prije pusha hvata nedostajuce COPY putanje, pokvarene reference izmedu faza i runtime neuspjehe prije nego stignu do pregleda ili CI-ja.