-
Notifications
You must be signed in to change notification settings - Fork 644
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 2.1 depends_on conditions not supported #888
Comments
I've just hit the same problem. Is there any news on this issue? |
No, there is no news on this (mostly because of lack of time, there is also no support for version 3 yet). Happy to take PRs though .... |
I've created a test for this - https://github.com/jimusbobus/docker-maven-plugin/commit/b2fee7935e18edfa2e52821e4fe6b90335105b29 I'd be more than happy to try and fix this, but i'm lost as where to start :) Swapping from lists to maps was not as simple as i had hoped.... |
For reference, here a full stack dump from v0.33 of the plugin.
|
The docker-maven-plugin needs to look at the node type and if it's a map, then use asMap() and extract the keys. On the other hand, if it's a List, then use asList() as it already does. It's unclear what the depends_on condition used by the docker-maven-plugin actually is, when not defined by the new condition docker-compose element. Does it was for healthy status? |
@jimusbobus the link you provided returns a 404. Do you have it still on hand ? |
Sorry no I do not, I moved on from that job and cleaned up all my old repositories and had forgotten about this issue and have deleted the repo :/ |
Hi! First of all, we love the Docker Maven Plugin! Thanks! ❤️ We're having the same problem trying to get our app to wait for postgres to start on Windows.
We're trying to add something like this:
|
fabric8io#888 As of Docker Compose v2.1, there is a new map-based long syntax to express dependencies of containers among each other that is much more sophisticated than the old list based. This commit solves the immediate problem described in fabric8io#888, where this new syntax is simply rejected. The dependsOn concept of DMP is now feed with the map's keys. Limitation: the wait conditions expressed with the new syntax are not added with this commit. See also: fabric8io#888 See also: https://github.com/compose-spec/compose-spec/blob/master/spec.md#long-syntax-1 See also: https://docs.docker.com/compose/compose-file/compose-file-v2/#depends_on
Thanks for raising this. Unfortunately, I'm not able to work on this plugin currently, and I have the feeling that the docker compose support is quite aged over the time. I guess @rohanKanojia also don't has much bandwidth to rigorously work on this part of the plugin, too, but we are happy to integrate any PRs that improve the docker compose support. |
I am already working on a feature branch to make this happen. PR forthcoming. |
…bric8io#888 Extract the Docker Compose v2.1+ depends_on conditions and apply them as Docker Maven Plugin waiting configurations. Limitations: this mapping requires an inversion of the data model in use. Docker Compose has waiting conditions located at the depending service, while this plugin puts them on the dependent service/s.
@rohanKanojia @rhuss I implemented transfering the compose conditions to wait configuration now. But I hit another wall: a compose file allows to specify a How shall I proceed? It takes quite a few changes to ship this kind of information. I'm also worried about compatibility: the current implementation supports adding healthchecks only via build configuration and not via compose file (at all). Should we create a fresh issue for this? Should this be two distinct PRs or one closing both? |
#888 As of Docker Compose v2.1, there is a new map-based long syntax to express dependencies of containers among each other that is much more sophisticated than the old list based. This commit solves the immediate problem described in #888, where this new syntax is simply rejected. The dependsOn concept of DMP is now feed with the map's keys. Limitation: the wait conditions expressed with the new syntax are not added with this commit. See also: #888 See also: https://github.com/compose-spec/compose-spec/blob/master/spec.md#long-syntax-1 See also: https://docs.docker.com/compose/compose-file/compose-file-v2/#depends_on
Extract the Docker Compose v2.1+ depends_on conditions and apply them as Docker Maven Plugin waiting configurations. Limitations: this mapping requires an inversion of the data model in use. Docker Compose has waiting conditions located at the depending service, while this plugin puts them on the dependent service/s.
Description
docker-compose.yml
Output:
Info
mvn -v
) :The text was updated successfully, but these errors were encountered: