Skip to main content
External.Name is deprecated, use name and external instead
Source Link
MikkaRin
  • 3.1k
  • 22
  • 35

Everybody has explained really well, so I'll add the necessary code with just one simple explanation.

Use a network created outside of docker-compose (an "external" network) with docker-compose version 3.5+.

Further explanation can be found here.

First docker-compose.yml file should define network with name giveItANamePlease as follows.

networks:
  my-network:
    name: giveItANamePlease
    driver: bridge

The services of first docker-compose.yml file can use network as follows:

networks:
  - my-network

In second docker-compose file, we need to proxy the network by using the network name which we have used in first docker-compose file, which in this case is giveItANamePlease:

networks:
  my-proxy-net:
    externalname:
  giveItANamePlease
    nameexternal: giveItANamePleasetrue

And now you can use my-proxy-net in services of a second docker-compose.yml file as follows.

networks:
  - my-proxy-net

Everybody has explained really well, so I'll add the necessary code with just one simple explanation.

Use a network created outside of docker-compose (an "external" network) with docker-compose version 3.5+.

Further explanation can be found here.

First docker-compose.yml file should define network with name giveItANamePlease as follows.

networks:
  my-network:
    name: giveItANamePlease
    driver: bridge

The services of first docker-compose.yml file can use network as follows:

networks:
  - my-network

In second docker-compose file, we need to proxy the network by using the network name which we have used in first docker-compose file, which in this case is giveItANamePlease:

networks:
  my-proxy-net:
    external:
      name: giveItANamePlease

And now you can use my-proxy-net in services of a second docker-compose.yml file as follows.

networks:
  - my-proxy-net

Everybody has explained really well, so I'll add the necessary code with just one simple explanation.

Use a network created outside of docker-compose (an "external" network) with docker-compose version 3.5+.

Further explanation can be found here.

First docker-compose.yml file should define network with name giveItANamePlease as follows.

networks:
  my-network:
    name: giveItANamePlease
    driver: bridge

The services of first docker-compose.yml file can use network as follows:

networks:
  - my-network

In second docker-compose file, we need to proxy the network by using the network name which we have used in first docker-compose file, which in this case is giveItANamePlease:

networks:
  my-proxy-net:
    name: giveItANamePlease
    external: true

And now you can use my-proxy-net in services of a second docker-compose.yml file as follows.

networks:
  - my-proxy-net
Source Link

Everybody has explained really well, so I'll add the necessary code with just one simple explanation.

Use a network created outside of docker-compose (an "external" network) with docker-compose version 3.5+.

Further explanation can be found here.

First docker-compose.yml file should define network with name giveItANamePlease as follows.

networks:
  my-network:
    name: giveItANamePlease
    driver: bridge

The services of first docker-compose.yml file can use network as follows:

networks:
  - my-network

In second docker-compose file, we need to proxy the network by using the network name which we have used in first docker-compose file, which in this case is giveItANamePlease:

networks:
  my-proxy-net:
    external:
      name: giveItANamePlease

And now you can use my-proxy-net in services of a second docker-compose.yml file as follows.

networks:
  - my-proxy-net