0

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 ?

firasKoubaa
  • 6,439
  • 25
  • 79
  • 148

1 Answers1

1

Create your shared network with docker network create (doc here) and define the network in the docker compose file as external (doc here)

bug
  • 3,900
  • 1
  • 13
  • 24