-
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 error when using depends_on
long syntax
#3880
Comments
Any update or thoughts from the developers on this? Not that |
+1 Guys, what is the status of the task? Need an implementation, how to push a task? |
There is a bug that has remained unfixed for approximately six months. It may be possible to use GPT-4 to write a PR to address the issue, as it has not received attention from officials. |
What is the state of this? Is there something to help with? |
I run into this today and only solution I can see is using |
Anyone using "docker compose -f fileA.yaml -f fileB.yaml config -o merged.yaml" will run into this issue when trying to deploy on swarm with "docker stack deploy -c merged.yaml stack". Ran into this issue when trying to use github action for stack deploy with multiple files (with https://github.com/kitconcept/docker-stack-deploy) |
I'm facing the same problem. I transitioned from the discussion at moby/moby#29133 (comment), then moved on to docker/compose#9306 (comment), and finally arrived at this current problem. |
docker stack is not compatible with it due to docker/cli#3880
hello there! there seems to be still an issue with depends_on when using ❯ docker compose -f compose.production.yaml config | docker stack deploy prod -c -
services.cli.depends_on must be a list
❯ cat compose.production.yaml
include:
- path:
- .docker/base.yaml
- .docker/db.yaml
❯ grep "depends_on" .docker/base.yaml -A3
depends_on:
- caddy
- redis
environment:
❯ docker compose -f compose.production.yaml config | grep "depends_on" -A7
depends_on:
caddy:
condition: service_started
required: true
redis:
condition: service_started
required: true
deploy: Why do I need this? What am I trying to do? I'd like to split complex compose files by using one of the latest compose features: ❯ docker stack deploy prod -c compose.production.yaml
(root) Additional property include is not allowed So this is why I tried to use At this point I have some questions and hope that someone here can provide answers: PS: I use Docker since 2015/2016 and it became a key figure in my toolbox. My journey with docker, docker compose and docker swarm was a lot of joy but recently and especially with complex projects it became also very frustrating as the tool one loved so much seems to truly rust. PPS: If there is a better place to put the above, please let me know. I will not hesitate to pass on my words to the right recipient. I have spoken. |
@jawys
docker stack does not support
docker swarm and
the parser being used by this command was used to produce compose-spec reference implementation, but evolved a lot in the meantime. Typically with introduction of
Nope. It just involves "docker compose" file as set by
That's terribly confusing, but that's our legacy. Things are even more insane as
Docker Inc does not own Docker Swarm anymore. This is a Mirantis product since https://www.mirantis.com/blog/mirantis-acquires-docker-enterprise-platform-business/ |
@ndeloof thank you very much for taking the time to give an adequate explanation to my questions. Appreciate it a lot <3 |
https://docs.docker.com/compose/compose-file/compose-file-v3/#depends_on So for now, this configuration will not take effect anyway, right? |
Anyone found a possible workaround for this issue? Since I cannot control the startup order of my containers Im having some problems where containers are spawned and crashing. Right now i'm using @hungpham2411 workaround with |
I've found the only real way to do this is to build the dependency management into your software. So if service X depends on service Y, you must add code that checks for Y to be available inside service X. It sucks but it winds up resulting in more robust software anyway. |
Description
Given the following dummy
docker-compose.yml
where serviceB finishes once run (in my real world example, it's a container that runs migrations on a database then dies)
The
docker compose up
command doesn't complain, however, thedocker stack deploy
command complains by saying thatI've tried running
docker compose up
and it doesn't complain about that, so I assume it works fordocker compose up
but not fordocker stack deploy
Documentation regarding long syntax of
depends_on
can be found herehttps://docs.docker.com/compose/compose-file/#long-syntax-1
Reproduce
docker-compose.yml
file I showeddocker stack deploy --compose-file docker-compose.yml example-stack
Expected behavior
The stack should start creating. With the example file I provided, it should complain that image
serviceA
doesn't exist because it's an example, but with real world images it should work and start the stack. However, what actually ends up happening is the error i stated above about the depends on not being a list.docker version
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: