Skip to content

Support Time-Based pull_policy in Docker Compose (e.g., once_per_day) #12563

@victorwads

Description

@victorwads

Description

Description

In large companies, where hundreds of developers work with company-managed images that receive updates multiple times per week, ensuring that everyone is using an up-to-date image is a real challenge.

Currently, developers need to manually remember to run docker compose pull from time to time. Often, they only realize their image is outdated after hours of debugging unexpected issues—just to discover that the problem was already fixed in a newer image.

🚀 Why Not Just Use pull_policy: always?

  • Setting pull_policy: always forces a docker pull on every docker compose up, even when there’s nothing new to update.
  • This significantly slows down the development workflow, especially in environments with large images.
  • Developers end up either:
    • Forgetting to pull images (causing issues).
    • Suffering slow startups every time they run docker compose up.
    • when offline or poor connection, this could take several time until docker give up to pull

🛠 Proposed Solution

Introduce a time-based pull_policy, such as:

services:
  my-service:
    image: company-registry.com/dev-image:latest
    pull_policy: once_per_day

Other possible values:

  • daily
  • weekly
  • custom: (e.g., custom:86400 for every 24 hours)

This would allow docker compose to automatically check if a pull has already happened today. If it has not, it performs the pull. If it has, it proceeds without pulling, ensuring a balance between up-to-date images and fast startup times.

📌 Feature Summary

  • Introduce pull_policy: once_per_day, once_per_week, etc.
  • Allow docker compose to track the last pull time and only update when necessary.
  • Improve developer workflow efficiency while ensuring images stay updated.
  • Reduce unnecessary network usage and startup delays.

This feature would make a real difference in large-scale development environments! 🚀 Would love to hear feedback from the Compose team. 😃

✍️ Tags:
enhancement, docker-compose, feature-request, pull-policy, developer-experience

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions