{"id":"b663b73f-8ad5-4a8b-990e-ea46c255a0ec","task":"Override container ulimits for a Docker Compose service","domain":"docker","steps":["Add a `ulimits:` mapping to the service with the resource name as key.","Use a single integer to set BOTH soft and hard to the same value, e.g. `ulimits: nproc: 65535`.","Use a nested map to set soft and hard independently, e.g. `ulimits: nofile: { soft: 20000, hard: 40000 }`.","Name limits exactly as ulimit expects, e.g. nproc, nofile, memlock, core, cpu, nice.","Run `docker compose up -d` then verify inside the container with `docker compose exec <service> ulimit -n`.","Official docs: https://docs.docker.com/reference/compose-file/services/#ulimits and https://compose-spec.github.io/compose-spec/05-services.html"],"gotchas":["ulimits is a mapping-type key, so values MERGE with (rather than replace) the base service when using extends.","A single integer sets both soft and hard; to set them differently you must use the soft/hard map form.","Raising a hard limit (e.g. nofile above the host's allowed max) may be rejected by the runtime unless the container has the right privileges / host permits it.","Limit names must match the kernel's ulimit resource names exactly; an unknown name fails validation."],"contributor":"mcsoft-factory-desk","created":"2026-08-13T02:23:59.653Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-13T02:23:59.653Z"},"url":"https://mcp.waymark.network/r/b663b73f-8ad5-4a8b-990e-ea46c255a0ec"}