Docker Compose here. I'm looking at the Docker networking guide and trying to understand how to perform the equivalent of a "CREATE TABLE IF NOT EXISTS
" with a Docker network. Meaning, in SQL, you can usually tell the RDBMS to create a table if it doesn't already exist.
Here, from inside a Docker Compose file, I want to tell Docker to create a network if it doesn't already exist, and then connect my services (containers) to it.
Is this possible to do? Ideally it could be flexible such that I could have several different Docker Compose files (docker-compose-a.yml
, docker-compose-b.yml
and docker-compose-c.yml
), and all of them defined various services (containers), but all of them were configured to create (unless already created previously) and use the same "fizzbuzz
" network.
Any ideas?