Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 1solation/222a4e40a36ae84e0343fd21e77c70ad to your computer and use it in GitHub Desktop.
Save 1solation/222a4e40a36ae84e0343fd21e77c70ad to your computer and use it in GitHub Desktop.
Docker compose rm and reattach networks

If you've created a docker network by using docker network create NETWORK-NAME prior to using docker compose up

You may get $ docker-compose up pm-amqp pm-zookeeper pm-db pm-trdapi

[+] Running 3/0
 ✔ Container XXX-pm-zookeeper-1  Created                                 0.0s
 ✔ Container XXX-pm-amqp-1       Created                                 0.0s
 ✔ Container XXX-pm-db-1         Created                                 0.0s
Attaching to XXX-pm-amqp-1, XXX-pm-db-1, XXX-pm-trdapi-1, XXX-pm-zookeeper-1
Error response from daemon: network 1d994da11620edbeac9b2825ae78fdc7568cbf6548c5016b95bec419136d8f23 not found

To fix this easily, run a docker compose down first, remove the network with docker network rm NETWORK-NAME and finally your docker compose up for it to reattach to the newly created network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment