fabric8io / docker-maven-plugin

Maven plugin for running and creating Docker images
https://dmp.fabric8.io
Apache License 2.0
1.88k stars 643 forks source link

New docker goal for pulling images. #750

Open nazardubenets opened 7 years ago

nazardubenets commented 7 years ago

It would be nice to have additional goal docke:pull to simply pull images from registry. As i understand that functionality is already present as part of docker:start, and that is useful to have this separately, without starting containers.

rhuss commented 7 years ago

The question is, what should be pulled ? All images without <build> section ? The base images for building images ?

So its semantically different and asymmetrical to docker:push which pushes only the build images (pulling the images we are building for doesn't make much sense).

Could you please describe briefly your concrete use case where such a feature would help you ?

nazardubenets commented 7 years ago

I meant pulling of all images described in <run> section without starting containers. At first i thought that if i add skipRun, or skip to <run> section, it will pull images and will not start containers at the same time. Is such scenario possible? In this case i can totally exchange scripts with docker commands to docker-maven-plugin.

rhuss commented 7 years ago

What about adding a 'dryRun' option to docker:run which actually would pull all missing images ? Maybe combined with a pullPolicy with values Always and IfNotPresent (similar to Kubernetes) to tune the way how pulling woks.

The only thing left is whether images with <build> section should be considered, too as they are usually never pulled (but the image just built is reused). Initially I would say we should skip these images for pulling.

@nazardubenets Would this solve your use case ?

nazardubenets commented 7 years ago

Yes. Adding of 'dryRun' suits very nicely. Then how 'pullPolicy' should be combined with 'autoPull' values?

nazardubenets commented 7 years ago

I agree that images from build should be skipped.