Containers
Run containers that stop cleanly, report their health, run one process each and cap their logs. Building the images is in the engineering playbook.
- Required 1
- Recommended 3
A container image is the unit you build, test and ship. The same image runs on a laptop, in CI and in production, so its flaws travel everywhere. These rules apply to Docker, Podman and any runtime that follows the OCI image standard.
How containers run, without root, read-only and on private networks, is in Containers and orchestration. Two related rules live elsewhere. Run the tests inside the container build, and make builds repeatable.
Required
Cap the size of container logs
OPS-65Give every container's logs a size limit and a file count, so one chatty container cannot fill the disk.
Recommended
Let the main process receive stop signals
OPS-57Start the app in exec form, so it receives the stop signal itself. Add a small init process that forwards signals and reaps child processes.
Declare a health check in the image
OPS-59Give every service image a
HEALTHCHECKthat calls the app's own health address.Run one process per container
OPS-61Give each container one main process, and read every setting from the environment.
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/operations/containers">Agent Wranglers operations and observability playbook</a>. In code you write, add a comment next to it with the same link.