|Compose V1/V2||Compose V3|
|Container Service does not support the use of the
||You can add applications into a custom network by using the
You can add a service to the custom network by specifying the application network when creating an application. You can implement inter-service communications by adding a service to one or more custom networks.
- You cannot change the network for an application after you add the application to a custom network.
- You cannot remove an application from the network after you add the application to the custom network. The application will be removed from the network only when you delete the application.
- swarmmode #Your custom network name.
- testswarm #Your custom network name.
networks: #Declare your custom networks.
You must declare the custom networks to be used by your application. Otherwise, an error will be reported during the application deployment.
external: true indicates that the custom network has been created. Therefore, Container Service will not try to create the custom network when the application is created, but will search for the custom network and add the application to the custom network.
externalparameter cannot be used together with other network configuration parameters (