Home:ALL Converter>Docker Swarm : how to fix a swarm network name

Docker Swarm : how to fix a swarm network name

Ask Time:2019-10-15T00:05:35         Author:firasKoubaa

Json Formatter

I'm using Docker swarm , There , within my docker-compose file i'm declaring a netwrk configuration:

services:
  myservice:
    ...
    networks:
     - myNetwork
    ...
networks:
  myNetwork:
     driver : overlay

After that i'm running : docker stack deploy myStack -c myComposefile.yml

The probleme that the resulting network is this :

    NETWORK ID          NAME                  DRIVER              SCOPE
    nu0iykhv5ewn        myStack_myNetwork     overlay             swarm

My problem is in the name of this network : "myStack_myNetwork"

How may i fix it to be only : "myNetwork"

Since i'm reusing this network in other stacks.

Suggestions ?

Author:firasKoubaa,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/58380381/docker-swarm-how-to-fix-a-swarm-network-name
yy