Open Hermain opened 6 years ago
This is because the network name check is being done client side, and the client in this case is windows, so it's not recognizing the host
network as a non-user defined network.
cc @vdemeester I believe you noticed this issue recently as well.
I believe the following PR (in moby) fixes it https://github.com/moby/moby/pull/36316 It should be in 18.03 GA I think
This issue is windows specific and does not affect linux with the exact same version. 36316 seems to fix something general though which affects linux too. I don't know why windows and linux clients behave differently on exactly the same version but this from my point of view is a critical issue. Not only can't I trust that an application on docker for windows will run as well as on native linux, now i can't even be sure that my stack file will be accepted by any system running the same version.
What about labelling it a bug?
I updated to the new 18.03 GA on windows and still get:
network "host" is declared as external, but it is not in the right scope: "local" instead of "swarm"
The same "local" instead of "swarm" ...
Server Version: 18.03.1-ce
Any update ?
This makes it really hard to use docker for windows for testing...
Just bumped into this :(
This still seems to be an issue
I have this issue on Docker version 19.03.5
running:
env $(cat .env |grep ^[A-Z] | xargs) docker stack deploy --compose-file docker-compose.stack.yaml backend
docker-stack.yaml
version: "3.4"
services:
api:
image: 'backend:b64b003'
networks:
- private
- public
ports:
- "4443:443"
- "8088:80"
environment:
ASPNETCORE_URLS: 'https://+;http://+'
ASPNETCORE_HTTPS_PORT: 443
ASPNETCORE_Kestrel__Certificates__Default__Password: ""
phpmyadmin:
#depends_on:
image: phpmyadmin/phpmyadmin
restart: always
networks:
- private
ports:
- '13306:80'
environment:
PMA_HOST: localhost
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
PMA_ABSOLUTE_URI: ${PMA_ABSOLUTE_URI}
PMA_SOCKET: /var/run/mysqld/mysqld.sock
volumes:
- /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock
- /var/run/mysqld/mysqld.sock:/tmp/mysqld.sock
volumes:
backend-api-https-pfx-volume:
elastic_data:
kibana_log:
portainer_data:
networks:
public:
driver: overlay
private:
driver: bridge
Description
I am trying to deploy a stack with a service using network host because this service needs to do a multicast.
As stated in the docs (https://docs.docker.com/compose/compose-file/#host-or-none) I declared an external netowrk called host and use that network in my service. This works perfectly fine on linux with docker 17.12.0-ce (or 17.12.1-ce or any other version I tested) however on docker for widnows with version 17.12.0 I get:
network "host" is declared as external, but it is not in the right scope: "local" instead of "swarm"
Steps to reproduce the issue:
Describe the results you received:
network "host" is declared as external, but it is not in the right scope: "local" instead of "swarm"
Describe the results you expected: Stack is successfully deployed
Additional information you deem important (e.g. issue happens only occasionally): When calling docker stack deploy from within a container running 17.10 which has the docker socket mounted the behaviour is as desired. Output of
docker version
:Output of
docker info
: