skybet / cali

Cali Automation Layout Initialiser
MIT License
32 stars 7 forks source link

Pull image logic #42

Open edupo opened 6 years ago

edupo commented 6 years ago

After #38 I had some comments I want to discuss with you let me know what you think:

When you want a docker image to be the latest version you usually do a pull image:latest or pull image but when you want to specify a fixed version like pull image:3.11 you probably don't want it to be updated to latest.

My suggestion, if there is no use case against it, will be to parse the image string and if it does not contain a tag or the tag is :latest then autoupdate. If a tag is specified then don't update until you specifically require it.

Tag can be found with a simple regular expression match with ':'

lucymhdavies commented 6 years ago

So we have three possible behaviours for what to do if an image already exists with the tag:

Personally, I prefer "Always Pull", but then I am almost never without internet access. "Pull if :latest" does seem like a good option too. Might even be that this becomes the default, as it encourages people to create new tags for their images, rather than re-release an existing tag.

"Never Pull" definitely seems like a useful option, and is current behaviour. For example, this is useful if you are in a low bandwidth situation, or even no internet connection at all., which is a use case I want to support.