You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe the problem.
Summary
ImagePullPolicy currently exposes only Default, Always, Missing, and Never. There is no way to express a periodic refresh. Docker Compose already supports exactly this via time-based pull_policy values (daily, weekly, every_<duration>). This issue requests parity in Aspire's ImagePullPolicy.
Motivation
A very common local-dev / CI pattern is a container pinned to a mutable tag such as :latest that an upstream pipeline rebuilds roughly once a day:
Today the available options are both unsatisfying:
Missing / Default — the cached :latest is reused forever and silently goes stale; you never pick up the daily rebuild unless you manually docker pull or prune.
Always — re-pulls on everyaspire run / startup. That adds pull latency to every launch and fails hard with no network (see Keeping referenced containers automatically up to date #10719), even though a day-old cached image would have been perfectly fine.
What's actually wanted is "keep it reasonably fresh, but don't pay the pull cost on every start".
What Docker Compose already does
The Compose spec supports time-based pull policies:
daily: check the registry if the last pull was more than 24h ago
Because Aspire maps WithImagePullPolicy(...) onto the generated Compose pull_policy when publishing to a Docker Compose environment, the current enum can't even emit these values today.
Describe the solution you'd like
Proposed API
Add time-based members / a factory to ImagePullPolicy, e.g.:
Semantics: before creating the container, if the locally cached image's pull/creation time is older than the interval, pull; otherwise reuse the cache.
Relationship to existing issues
Keeping referenced containers automatically up to date #10719 (ImagePullPolicy.IfPossible) is related but orthogonal: it asks for "pull if the network is available, otherwise fall back to cache." A time-based policy is about how often to attempt a pull, not about network-failure fallback. Ideally the two compose.
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
Summary
ImagePullPolicycurrently exposes onlyDefault,Always,Missing, andNever. There is no way to express a periodic refresh. Docker Compose already supports exactly this via time-basedpull_policyvalues (daily,weekly,every_<duration>). This issue requests parity in Aspire'sImagePullPolicy.Motivation
A very common local-dev / CI pattern is a container pinned to a mutable tag such as
:latestthat an upstream pipeline rebuilds roughly once a day:Today the available options are both unsatisfying:
Missing/Default— the cached:latestis reused forever and silently goes stale; you never pick up the daily rebuild unless you manuallydocker pullor prune.Always— re-pulls on everyaspire run/ startup. That adds pull latency to every launch and fails hard with no network (see Keeping referenced containers automatically up to date #10719), even though a day-old cached image would have been perfectly fine.What's actually wanted is "keep it reasonably fresh, but don't pay the pull cost on every start".
What Docker Compose already does
The Compose spec supports time-based pull policies:
daily: check the registry if the last pull was more than 24h agoweekly: same, for 7 daysevery_<duration>:every_12h,every_2d,every_1h30mDocs: https://docs.docker.com/reference/compose-file/services/#pull_policy
Because Aspire maps
WithImagePullPolicy(...)onto the generated Composepull_policywhen publishing to a Docker Compose environment, the current enum can't even emit these values today.Describe the solution you'd like
Proposed API
Add time-based members / a factory to
ImagePullPolicy, e.g.:Semantics: before creating the container, if the locally cached image's pull/creation time is older than the interval, pull; otherwise reuse the cache.
Relationship to existing issues
ImagePullPolicy.IfPossible) is related but orthogonal: it asks for "pull if the network is available, otherwise fall back to cache." A time-based policy is about how often to attempt a pull, not about network-failure fallback. Ideally the two compose.WithImagePullPolicyin the first place (13.2).Additional context
Aspire
ImagePullPolicymembers as of today:Default,Always,Missing,Never