-
Notifications
You must be signed in to change notification settings - Fork 2k
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 stack deploy ignores network name in compose file #971
Comments
@parisk thx for the issue report. It should be fixed by #941. Sadly, I think it's only be available in 18.04 and later. cc @thaJeztah |
Indeed. Thanks for the heads up. Closing this, since there is no further action needed to be taken from now on. |
I'm running 18.09.1 and this seems to be an issue still or am I doing something incorrectly? I'm getting |
@ademeglio that's expected; when deploying a stack, the services are connected to a default network for that stack. The network that's created is prefixed with the stack name, so that it doesn't conflict with other "default" networks |
@thaJeztah OK, thank you. I think it is a user error mistake on my part then ;-) I did not see adding adding a network name within the network call in part 5 of the tutorial. I'm going to try that now.
|
If you don't want to set the network for each service, I think you can also set the name for the stack's default network; services:
yourService:
image: yourImage
...
networks:
default:
name: yourNetworkName |
@thaJeztah |
The service must publish a port to be accessible; after that it should be available at |
So, you had me thinking and this morning I went back to the tutorial and I was able to create a service and connect just fine from the browser. I redeployed the application I'm using to test my CI/CD process and as a stack, even though the service shows the port exposed the same as the lone service, will not connect. So there must be something I'm doing incorrectly when doing |
OK, now I'm confused. Here is the output of the service after performing a service ls and then a service inspect.
Then I ran
I don't see any difference between the two, but I was able to access the app without any other changes. Would that be an issue with stack deploy not acting on the publish lines of the docker-compose file? |
So, I'm not sure what I changed, but after redeploying again, it works as expected. @thaJeztah I appreciate your help and insight, Cheers, Anthony |
Description
I would like to explicitly name the networks created when deploying a stack on Docker's Swarm Mode, by using the corresponding syntax introduced in Compose file 3.5.
docker stack deploy
seems to ignore this though and creates the network with the default name.Definitely not crucial, but it would be a good-to-have.
Steps to reproduce the issue:
name
top-level network parameter introduced in Compose file 3.5 (example file)docker stack deploy -c docker-compose.yml stack-name
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Running on an Azure Ubuntu machine, installed via
apt-get
.The text was updated successfully, but these errors were encountered: