IssueRaiser

Docker Stack Deploy error when using `depends_on` long syntax

### Description Given the following dummy `docker-compose.yml` ``` version: '3.9' services: serviceA: image: serviceA:version1 serviceB: image: serviceB:version2 depends_on: serviceA: condition: service_completed_successfully ``` 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, the `docker stack deploy` command complains by saying that ``` services.serviceB.depends_on must be a list ``` I've tried running `docker compose up` and it doesn't complain about that, so I assume it works for `docker compose up` but not for `docker stack deploy` Documentation regarding long syntax of `depends_on` can be found here https://docs.docker.com/compose/compose-file/#long-syntax-1 ### Reproduce 1. Create the `docker-compose.yml` file I showed 2. Execute `docker 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 ```bash Client: Docker Engine - Community Version: 20.10.9 API version: 1.41 Go version: go1.16.8 Git commit: c2ea9b

Posted by jruiz94 on Nov 25, 2022, 10:24 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

github (Other)

Docker Stack Deploy error when using `depends_on` long syntax

jruiz94Nov 25, 2022, 10:24 AM

### Description Given the following dummy `docker-compose.yml` ``` version: '3.9' services: serviceA: image: serviceA:version1 serviceB: image: serviceB:version2 depends_on: serviceA: condition: service_completed_successfully ``` 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, the `docker stack deploy` command complains by saying that ``` services.serviceB.depends_on must be a list ``` I've tried running `docker compose up` and it doesn't complain about that, so I assume it works for `docker compose up` but not for `docker stack deploy` Documentation regarding long syntax of `depends_on` can be found here https://docs.docker.com/compose/compose-file/#long-syntax-1 ### Reproduce 1. Create the `docker-compose.yml` file I showed 2. Execute `docker 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 ```bash Client: Docker Engine - Community Version: 20.10.9 API version: 1.41 Go version: go1.16.8 Git commit: c2ea9b

Comments (0)

No comments yet. Start the discussion.

Comment on this issue