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

Option to always pull image when creating a container #601

Closed
BenasB opened this issue Oct 4, 2022 · 3 comments
Closed

Option to always pull image when creating a container #601

BenasB opened this issue Oct 4, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@BenasB
Copy link
Contributor

BenasB commented Oct 4, 2022

Is your feature request related to a problem? Please describe.
I have a case where my tests should always retrieve the latest image. AFAIK, this library now pulls an image only if it's missing (sort of like docker run --pull "missing" ..., which is the default) but I would like to always pull the image (so it gets the most up to date version of it) before starting the container (like docker run --pull "always" ... does).

Describe the solution you'd like
An option that enables this behavior would be perfect, for example a .WithImagePull(PullType) builder method where PullType could be Missing (default behavior) or Always. Although I am not sure how this could be implemented.

Describe alternatives you've considered
The image pull can be done explicitly before building/starting the container by using Docker.DotNet directly and this would be okay, but testcontainers-dotnet already has support for credential helpers (AFAIK Docker.DotNet does not support that) which I'm trying to take advantage of (since I'm authenticating to a private registry)

How much would this be feasible? Thanks!

@HofmeisterAn
Copy link
Collaborator

An equivalent to the Java withImagePullPolicy would be great.

@HofmeisterAn HofmeisterAn added the enhancement New feature or request label Oct 5, 2022
@BenasB
Copy link
Contributor Author

BenasB commented Oct 5, 2022

That's exactly what I've imagined, although I don't have experience with the Java version. I will try to take a look at how it's implemented there and see how I could implement a similar feature for testcontainers-dotnet

@kiview
Copy link
Member

kiview commented Oct 5, 2022

@BenasB Let us know if you have any questions regarding the Java implementation 🙂

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

No branches or pull requests

3 participants