Skip to content
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

cleanup is not defaulting to true #338

Closed
pnsantos opened this issue Nov 25, 2015 · 5 comments
Closed

cleanup is not defaulting to true #338

pnsantos opened this issue Nov 25, 2015 · 5 comments
Assignees
Labels
Milestone

Comments

@pnsantos
Copy link

Hi, recently started using docker together with this plugin (pretty nice plugin!).

I noticed that when I build an image that has already been built, dangling images were being left behind. From the docs:

cleanup indicates if dangling (untagged) images should be cleaned up during each build. Default is true

the cleanup config param is supposed to address this, and it does indeed! However it's seems that the default value is false and not true as the documentation mentions which means it needs to be explicitly set to true.

Not sure if it's the docs that are wrong, or if the cleanup should indeed default to true (I would assume the latter, right?).

Using version 0.13.6

@rhuss
Copy link
Collaborator

rhuss commented Nov 26, 2015

Thanks for pointing that out. You are absolutely correct, the documentation doesn't fit the implementation. Since documentation in that case is more normative ;-) I changed now the default implementation to remove the intermediate image.

rhuss added a commit that referenced this issue Nov 26, 2015
@rhuss rhuss added the fixed label Nov 26, 2015
@rhuss rhuss added this to the 0.13.7 milestone Nov 26, 2015
@pnsantos
Copy link
Author

Hi @rhuss, if you don't mind I have question. Not sure if I'm following standard practice but I'm using the plugin to generate an images with the version as a tag. Whenever I docker:build with the same version I want the local image to be replaced by the new one. The issue is that any docker:build I run after a docker:run (for the same version) will fail with

DOCKER> conflict: unable to delete 1fcbb0918ae1 (must be forced) - image is being used by stopped container faddd020f244 (Conflict: 409)

The solution is of course remove the container before doing another docker:build but that kind of gets annoying after a while...

Is there any way I can specify for existing (non-running) containers associated with the image to be removed to also be removed? Or maybe even adding that option?

@rhuss
Copy link
Collaborator

rhuss commented Nov 27, 2015

If you start a container with docker:start and stop it with docker:stop then by default the container gets removed. This is not the case when using docker:start -Ddocker.follow and stop it with CTRL-C or when you stop it outside of the plugin. Also, when you set <keepContainer> the container won't be removed, too.

How does you workflow looks like ? (i.e. how do you start and stop the containers ?)

@pnsantos
Copy link
Author

ah ok, I was using docker:start to start it but using the commandline docker stop <name> to stop it.

Thanks for the info!

@jgangemi
Copy link
Collaborator

jgangemi commented Dec 1, 2015

yeah - know what i learned the other day? @parameter default-value="false" doesn't work on objects that maven constructs, it's only valid when defined directly on a field in the mojo class.

not that it would have had any effect here, but i just thought i'd point that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants