overexchange
overexchange

Reputation: 1

docker compose - What does external property signify under networks?

In the below docker-compose file:

version: '2'
networks:
  network1:
    name: my-net
    driver: bridge
    external: true

What does external property signify?

Upvotes: 5

Views: 4959

Answers (1)

Shashank V
Shashank V

Reputation: 11193

It means docker-compose won't create the network. The network should be created externally before running docker-compose up. By default, compose manages the network creation. external: True flag is used to make the containers join a pre-existing network instead.

From docs:

external

If set to true, specifies that this network has been created outside of Compose. docker-compose up does not attempt to create it, and raises an error if it doesn’t exist.

Upvotes: 8

Related Questions