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

create: config to pull latest image by default #289

Merged
merged 1 commit into from
May 25, 2022
Merged

Conversation

juhp
Copy link
Contributor

@juhp juhp commented May 24, 2022

This is a potential solution to #288, which gives
the user the chance to always create a new toolbox with
the latest most current image, instead of an old out-dated one.

@89luca89
Copy link
Owner

Hi @juhp thanks!
Will test a bit the changes 👍

@89luca89
Copy link
Owner

Using it a bit, we might want to change a bit the behavior on this

Right now, every time I create it asks you want to pull? y/N
This does not make a lot of sense in the optics of having always the latest image
And more confusing is, if I say No, it creates the container if the image is present, which is a bit confusing

So either we could (as you proposed in #289 ) to have a --pull flag, which can be forgetful
or we could implement an ENV variable + config for container_always_pull for this

That would also set the non_interactive to 1, so that it does not ask questions

What do you think?

@juhp
Copy link
Contributor Author

juhp commented May 25, 2022

Thanks for testing - I only really tried the default interactive case myself so far.

Right now, every time I create it asks you want to pull? [Y/n]

Correct

This does not make a lot of sense in the optics of having always the latest image

Do you mean it doesn't make sense if one already has the latest?
Well that is true, but it is hard to detect, so IMHO it is easier to always attempt to pull.

And more confusing is, if I say No, it creates the container if the image is present, which is a bit confusing

So now "No" meant don't pull a new image (it is pretty similar to the old behavior with an existing image).

So either we could (as you proposed in #289 ) to have a --pull flag, which can be forgetful or we could implement an ENV variable + config for container_always_pull for this

Okay, thanks, sounds good enough to me, let's try that then.
Then one doesn't even have to answer the prompt which is even better really (once setup).

@89luca89
Copy link
Owner

89luca89 commented May 25, 2022

Thanks for testing - I only really tried the default interactive case myself so far.

Thanks to you for the PR 😄

Okay, thanks, sounds good enough to me, let's try that then. Then one doesn't even have to answer the prompt which is even better really (once setup).

Yep should be less confusing, maintaining the current behavior (in main so don't pull if present) and bypass it only in case of config and/or ENV variable

@juhp
Copy link
Contributor Author

juhp commented May 25, 2022

How about this then?

distrobox-create Show resolved Hide resolved
@89luca89
Copy link
Owner

How about this then?

Great exactly what I was thinking 😄

There is one error for undefined variable in the code
Also we should update the usage in docs/usage/distrobox-create.md to reflect this change, and add also a couple of examples

Man pages are automatically generated from that change, so no need to recreate them yourself 👍

…uca89#288)

If either DBX_CONTAINER_ALWAYS_PULL or container_always_pull in config is set,
'create' will pull the latest image without prompting
(even if image already exists locally).
Use this to ensure the new toolbox is based on the most current image
instead of an old out-dated one.
@juhp
Copy link
Contributor Author

juhp commented May 25, 2022

Ah yes thanks - hopefully better now and added more docs coverage.
I also added a corresponding --pull option.

@89luca89
Copy link
Owner

Thanks a lot for the contribution!

@89luca89 89luca89 merged commit 6c40457 into 89luca89:main May 25, 2022
@juhp
Copy link
Contributor Author

juhp commented May 25, 2022

Thanks for your help too :-)

@juhp juhp changed the title create: prompt to download latest image by default create: config to pull latest image by default May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants