Docker Resource Limits: Stop Letting Containers Eat Your RAM
Learn how to set Docker resource limits for memory, CPU, swap, and PIDs. Practical guide with real-world sizing examples, OOM killer behavior, and cgroups explained.
All the articles with the tag "containers".
Learn how to set Docker resource limits for memory, CPU, swap, and PIDs. Practical guide with real-world sizing examples, OOM killer behavior, and cgroups explained.
CMD and ENTRYPOINT work together rather than competing. Exec form vs shell form, the full behavior matrix, the combo pattern, and the debug override.
Profiles let you conditionally start services in Compose. Perfect for dev vs prod service splits without multiple files.
docker system prune reclaims space and can delete volumes you wanted. What each cleanup command removes, how to check usage first, and a safe script.
ENV bakes secrets into image layers that docker history shows to anyone. Use BuildKit secret mounts, runtime variables, or a real secrets manager.
The latest tag does not mean newest, it means whatever was pushed untagged. Why that breaks reproducible deploys and how to pin versions and digests.
Network aliases give a container more than one DNS name on a Docker network. Blue-green and canary deploy patterns, a Compose example, and the limits.
Master Docker HEALTHCHECK syntax. Learn what checks work, how to tune interval/timeout/retries, and integrate with orchestration.
Containers run as root by default, which is a real security problem. The USER instruction, numeric UID/GID, the volume mount gotcha, and distroless bases.
Docker labels are free metadata for filtering, routing, and documentation. Learn label conventions and leverage them with filters and tools.
Docker layer caching explains most slow builds. Why copying files too early kills the cache, the layer ordering that fixes it, and a multi-stage benchmark.
Decode Docker exit codes: 0 (success), 1 (app error), 125/126/127 (Docker errors), 137 (OOM), 143 (SIGTERM). Debug restarts in minutes.