Expose Image Pull Policy on Containers #7350
Labels
area-app-model
Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
area-orchestrator
Milestone
Is there an existing issue for this?
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 yourlatest
tag is many versions behind if you haven't explicitly done adocker 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
ondocker container create
. Alternatively it can be implemented by explicitly runningdocker pull
before creating the container imageDescribe the solution you'd like
From a user perspective, I imagine this being a
WithImagePullPolicy
extension method on IResourceBuilderThe 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
orproduction
) 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.
The text was updated successfully, but these errors were encountered: