1---2name: dockerfile3description: Use when editing tracked Backstage, agent, MCP, or Golden Path Dockerfiles.4---56<!-- Generated from harness/github-copilot/plugins/open-horizons-platform/instructions/dockerfile.instructions.md by harness/claude-code/scripts/convert_from_copilot.py. Edit the source, not this file. -->78# Dockerfiles910## Conventions1112- Pin base images to an explicit supported version; production Dockerfiles must not use `latest`.13- Use multi-stage builds so compilers, caches, tests, and development dependencies stay out of the runtime image.14- Copy dependency manifests before source to preserve cacheability and use the package manager matching the lockfile.15- Run the final process as a non-root user with only required files and writable directories.16- Keep credentials out of `ARG`, `ENV`, layers, build context, and package-manager configuration; use build secrets only in approved CI.17- Use exec-form entrypoints, propagate termination signals, and expose only documented service ports.18- Minimize packages, remove caches in the same layer, and keep runtime versions aligned with local manifests.19- Keep health behavior consistent with Compose and Kubernetes probes rather than adding a conflicting endpoint.2021## Verification2223- The intended target builds from a clean context.24- Image inspection confirms the non-root user, pinned base, and absence of secret material.25- The container starts and responds on its documented health endpoint.2627## Do / Do Not2829| Do | Do not |30| --- | --- |31| Pin base images, minimize build context, and execute as a non-root user. | Bake credentials, mutable bases, or unnecessary build artifacts into an image. |32| Keep health behavior aligned with deployed probes. | Add a conflicting or artificial health endpoint. |3334## Checklist Before Opening a PR3536- [ ] The change matches this instruction's `applyTo` scope.37- [ ] The intended target builds from a clean context.38- [ ] Image inspection verifies the base, user, and absence of secrets.39- [ ] The container responds on the documented health endpoint.40- [ ] No unrelated edits or unresolved placeholders remain.