Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose version '3' cannot try to use pre-exist overlay network. #4413

Closed
darkrasid opened this issue Feb 1, 2017 · 3 comments
Closed

Comments

@darkrasid
Copy link

Hi, I try to make compose file that deploy to swarm mode.

First, sorry for my English and

Second, my docker and compose versions are
docker : 1.3.0
docker-compose : 1.10.

I made a docker-compose file somthing like below.

version: "3"

services:
  redis:
    image: myrepo/redis:latest
    volumes:
      - /home/user/docker/discourse/redis:/var/lib/redis:Z

  web:
    image: myrepo/web:latest
    env_file: .env
    deploy:
      replicas: 2
      update_config:
        parallelism: 1

networks:
  default:
    external:
      name: test_overlay

I already make test_overlay network.

And after trying sudo docker stack deploy --compose-file=docker-compose.yml test I got Error response from daemon: network test_default not found

I think compose ignore the pre-exist network name and try to find {stack_name_default} network.

Am I missing something?

When I try to using bridge network and docker-compose up, it works fine.

@mostolog
Copy link

mostolog commented Feb 1, 2017

Mine is working.. Created with --driver overlay and --attachable...

@shin-
Copy link

shin- commented Feb 1, 2017

You can't substitute the default network like that. You'll need to name it and reference it explicitly in your service configurations.

version: "3"

services:
  redis:
    networks:
      - ovl_net
    image: myrepo/redis:latest
    volumes:
      - /home/user/docker/discourse/redis:/var/lib/redis:Z

  web:
    image: myrepo/web:latest
    networks:
      - ovl_net
    env_file: .env
    deploy:
      replicas: 2
      update_config:
        parallelism: 1

networks:
  ovl_net:
    external:
      name: test_overlay

@darkrasid
Copy link
Author

@shin- Thank you. It works. I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants