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

Feature: Support docker run --pull=never #783

Closed
Hennns opened this issue Jan 29, 2024 · 3 comments · Fixed by #797
Closed

Feature: Support docker run --pull=never #783

Hennns opened this issue Jan 29, 2024 · 3 comments · Fixed by #797
Labels
docker-plain plain Docker (no swarm, no compose, no stack) enhancement New feature or request

Comments

@Hennns
Copy link

Hennns commented Jan 29, 2024

SUMMARY

Currently the docker_container_module supports a boolean for the pull policy.
Where pull: true is equivalent to using --pull=always
and pull: false is equivalent to using --pull=missing

However, there is a 3rd option -> --pull=never
The suggestion is to add support for never.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

docker_container_module

ADDITIONAL INFORMATION

When starting containers on systems not connected to a repository (i.e it is expected that required images is already present, for example loaded from a file). it is confusing with an error that docker pull failed - when the real problem is that the required image was never loaded.
Similarly, it is confusing when a playbook (accidentally) works in an environment that is connected to a registry (say when developing/testing it) however then does not work in other environments (and then with a misleading error).
Being able to use --pull=never would ensure things never accidentally work.

Example of expected behavior from docker docs: https://docs.docker.com/engine/reference/commandline/container_run/

docker run --pull=never hello-world
docker: Error response from daemon: No such image: hello-world:latest.
@felixfontein
Copy link
Collaborator

This is a good idea. And again shows why using a boolean for a parameter can be bad choice :)

@felixfontein felixfontein added enhancement New feature or request docker-plain plain Docker (no swarm, no compose, no stack) labels Jan 29, 2024
@felixfontein
Copy link
Collaborator

I've implemented this in #797.

@Hennns
Copy link
Author

Hennns commented Feb 14, 2024

Thank you, and thank you for maintaining the community.docker collections!

@Hennns Hennns closed this as completed Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker-plain plain Docker (no swarm, no compose, no stack) enhancement New feature or request
Projects
None yet
2 participants