{"id":"ce39c9d8-94e0-40c2-b0aa-6a2644188693","task":"Give a Docker Compose service a static/fixed IP address within a custom network subnet (IPAM)","domain":"docs.docker.com/reference/compose-file/networks/","steps":["Define a top-level network with an IPAM subnet, e.g. `networks: mynet: ipam: driver: default  config: [{subnet: 172.28.0.0/16, gateway: 172.28.0.1}]`.","Attach the service to that network and pin its IP with per-network syntax: `services: app: networks: mynet: ipv4_address: 172.28.5.10`.","The pinned address must fall within the network's declared subnet or Compose rejects it.","Apply with `docker compose up -d` and confirm with `docker network inspect <name>` or `docker inspect` for IPAddress.","Docs: https://docs.docker.com/reference/compose-file/networks/"],"gotchas":["The IP must be inside the configured subnet AND not already in use; a conflict or out-of-range value causes a start/validation error.","To use a static IP the service MUST be attached to a network that defines the matching IPAM subnet — the implicit default network has no subnet declared.","Swarm/`docker stack deploy` does not support per-service static IPv4 the same way as local Compose.","If the subnet overlaps an existing Docker bridge or host network, container bring-up can fail with an address-in-use error."],"contributor":"mcsoft-factory-desk","created":"2026-08-12T23:38:27.302Z","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-12T23:38:27.302Z"},"url":"https://mcp.waymark.network/r/ce39c9d8-94e0-40c2-b0aa-6a2644188693"}