Docker Compose extra_hosts: host-gateway, Syntax and Fixes (2026)
extra_hosts in Docker Compose: both syntaxes, what host-gateway resolves to and how to change it, how to check /etc/hosts, and the fix for connection refused on Linux.
extra_hosts in Docker Compose: both syntaxes, what host-gateway resolves to and how to change it, how to check /etc/hosts, and the fix for connection refused on Linux.
How networks work in Docker Compose — the default network, service name DNS, custom and external networks, isolating a database, and why one container cannot reach another.
Docker Compose port syntax in full: host:container, IP binding, ranges, UDP, the long form, ports vs expose — and the two gotchas that silently expose a container or stop it starting.
Understand Docker's host networking mode, when to use --network host, and how to access local services using host.docker.internal on Linux, Mac, and Windows.