-
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:stop stops containers it shouldn't #87
Comments
Yes, I know it works a bit like a sledge hammer ;-) Initially The current behaviour was introduced to make things a bit easier (but the best way to stop a container is still Also, what should be stopped when
Both containers, the last one only or the first ? What I wonder, whether it could be possible to attach Meta-Data when starting a container, which could be queried when doing a |
yeah - i'm not a huge fan of writing out a file either. i think the behavior would continue to be the same as it is today, if you run docker doesn't currently support this but it looks like there is a proposal/pull request (moby/moby#9882) that is trying to push this forward, so i guess we can back burner this for a little bit. depending on if we wanted to support older versions of docker, we could use environment variables to store this info and query it using at the same time, there's no reason we couldn't support both and then those users that can't upgrade wouldn't be left in the lurch if they really needed this. i'll keep an eye on that proposal and give this some more thought. |
there's also this moby/moby#10599 which i just discovered today. |
What's about setting an artificial environment variable during start holding the meta data which then is then looked up when stopping a container ? E.g. an env var |
i actually thought about doing that and it would work for ppl who can't immediately upgrade once docker decides on how it will handle meta-data. i'll start putting something together for this. |
@jgangemi if you don't mind, I would to start to work on that so that I can include it into 0.11.3 (there are more people now requesting it) |
go ahead - i've been tied up w/ the day job and some other things as of late so i haven't had the time to work on this. |
no problem, I know how this is ;-) ok, will take over this issue .... |
I am not entirely sure if it is the same issue but... The containers do share the same image name indeed they are all java:8 containers but what I don't quite understand is why the plugin doesn't simply relay on the pom file on which it runs? |
i think it's the same issue. stop uses the image name b/c that's how it's implemented. as @rhuss said in a previous comment, it's a bit of a sledgehammer. i worked around this by just packaging the artifacts into the jdk container, the disk usage is the same and after i had a data-volume get deleted leaving me unable to restart an app, it seemed a bit safer :) but i realize that may not work for you. i'm not sure how far along the implementation is - i've been super busy w/ some other things but they are starting to circle back around to where i'll find some time to address some issues that are paining me. :) @rhuss just started a new job (congrats!) so i'm not sure what his status is. once he responds we can go from there. |
I'm on it, currently I'm experimenting by (mis-)using environment variables as lifecycle tags so that container can be correlated back to the pom.xml (even for a future process). It's a tricky business, though. I'm afraid it won't make it to 0.11.4 but to 0.12.0 soon after (prototype is working). Thanks for the congratulations and since I'm now working for Red Hat if can spent my whole time on working on Open Source ;-). I won't work fulltime on this plugin, of course, but can hopefully be much more reactive than the last half year. Thank you for your patience ;-) |
Now that labels are supported by Docker on various levels, I should switch my env based implementation before releasing it. will take probably still yet another release. |
Not yet, just rediscovered this issue :) |
any further updates on this one? if you don't have the time, if you pushed the branch i could pick it up. |
Sorry, not yet. But I will rebase my branch I had (if it is not to far way already) and will push it so that you could pick it up. |
This env variable WHALE_DMP_LABEL is used to mark containers to belong to a certain build so that can be recognized when calling 'docker:stop' #87
Related to #87, still missing: Query for labels and stopping based on maven coordinates.
Just pushed branch Should work:
Still missing:
Shouldn't be to much to do (hope so ;-) |
This env variable WHALE_DMP_LABEL is used to mark containers to belong to a certain build so that can be recognized when calling 'docker:stop' #87
Related to #87, still missing: Query for labels and stopping based on maven coordinates.
this is finally going to get fixed - we can't run tests in parallel at the day job w/o this so it just became my top priority! |
as part of fixing this, i think we should move forward one release in the docker api to as of |
This env variable WHALE_DMP_LABEL is used to mark containers to belong to a certain build so that can be recognized when calling 'docker:stop' #87
Related to #87, still missing: Query for labels and stopping based on maven coordinates.
* Label is renamed to 'dmp.coordinates' * `runId` removed from label * renamed property for stopping all containers from the images to 'docker.allContainers' so that a 'mvn docker:stop -Ddocker.allContainers' will reproduce the old behaviour. * Some minor refactorings See also #87.
Thanks a lot for the PR. I did some cleanup and refactorings, hope that's ok. See the commit message rhuss@229584c for details. |
aww, i really wanted to keep |
Yeah, thought that you would insist on it :) Let's add it as alias, no problem :) I will do this. |
haha - thanks! |
Oops. Forgot the alias ;-( Will add it for 0.14.0 ... sorry. |
Added support for encrypted passwords
docker:stop
will stop running containers that share the same image name but are completely unrelated to the configuration specified in the pom.given maven is stateless, i'm not really sure how this would be tracked short of writing a file containing the actual container names some place the plugin could later reference when the goal runs.
i'm not sure it's kosher to write the file in
${basedir}
, so it could be written totarget
but if the user were to run amvn clean
before adocker:stop
, they'd end up trashing the file and the stop would fail requiring manual cleanup.perhaps as a fallback it could default to current behavior if the file isn't found?
or it could fail and the user could do something like
mvn docker:stop -DforceCleanup=true
to cause the current behavior to be applied.The text was updated successfully, but these errors were encountered: