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

Expose Image Pull Policy on Containers #7350

Open
1 task done
afscrome opened this issue Jan 31, 2025 · 0 comments
Open
1 task done

Expose Image Pull Policy on Containers #7350

afscrome opened this issue Jan 31, 2025 · 0 comments

Comments

@afscrome
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Currently if you reference the container via a mutable tag (e.g. redis:latest), then docker will only pull the latest version of that tag if one doesn't exist locally. This could mean that your latest tag is many versions behind if you haven't explicitly done a docker pull redis:latest to refresh your local version.

Docker Compose and Kubernetes expose Image Pull Policies that can be used to configure this behavior, it would be nice if Aspire exposes the same.

This functionality is available through --pull on docker container create. Alternatively it can be implemented by explicitly running docker pull before creating the container image

Describe the solution you'd like

From a user perspective, I imagine this being a WithImagePullPolicy extension method on IResourceBuilder

container
    .WithImagePullPolicy(ImagePullPolicy.Always) // Always | Missing (default) | Never

The naming of the method and arguments matching what are used by Kubernetes & docker for this same capability:

Additional context

We're looking to create a number of internal components re-distributing our production services as ContainerResources via shared nuget packages. These services follow a trunk based CD model and could be released several times a day - because of this we want our aspire component to reference a mutable container tag (e.g. latest or production) and not have to update the version number in our nuget package every release, and then get all consumers to )

In our early days of rolling this out, we've already encountered a couple of issues at this point which we root causes as being caused by the consumer having an ancient version of the container that they used for some ad-hoc testing 1-2 years ago! Having the ability to set an image pull policy to always would greatly help.

@afscrome afscrome changed the title Expose --pull Expose Image Pull Policy on Containers Jan 31, 2025
@davidfowl davidfowl added this to the Backlog milestone Jan 31, 2025
@karolz-ms karolz-ms added untriaged New issue has not been triaged and removed untriaged New issue has not been triaged labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants