Docker Compose fails when an external network is missing; create it before running up

Docker Compose refuses to start when a network is declared with external: true but does not already exist, because Compose never creates such a network itself. The failure occurs immediately, before any image is pulled or container created, and names the network rather than a service. This commonly happens on CI runners, where a file that works on a developer machine lacks the network because no job step created it. Possible causes include no create step in the job, a name mismatch caused by Compose's project-name prefixing, a prune removing the unused network between steps, or a fresh runner that never had the network. The suggested fixes are to idempotently create the network before docker compose up, or to drop external: true so Compose manages the network.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in