-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Support Time-Based pull_policy in Docker Compose (e.g., once_per_day) #12563
Comments
That would be an interesting feature, but docker engine doesn't store the time image has been pulled, so we could compute "need to be checked for update after xx" condition. So this is technically not feasible until engine offers such a feature |
Ok. I suppose then we should open a pr on docker to make, some how, a registry of when the images have been last cached on disk. Docker-compose would use this information to decide if a pull trial should be performed after pull policy specified time. Does that make sense? |
@ndeloof @marlon-sousa compose could easyly just save this meta data on any userData file, just to control last time compose did pull something. We don't need to validade with docker the last pull. |
@victorwads it could but Compose (without |
@ndeloof agreed. Then first we need to make this info available to docker, right?
Does compose connect to other engines? I thought docker would be the only engine. If otherwise, then things start to get complicated. Is there any ref documentation on thius matter? |
Compose (and any By the way, Compose only relies on Moby API, so can also access an alternative implementation (typically, some use compose with podman) as long as the API is well implemented. |
Actually, moby/moby#31497 introduced image metadata which can be used to know last time image was pulled. |
For this part, we should look where most time is taken; effectively, a time docker pull --quiet ubuntu
docker.io/library/ubuntu:latest
real 0m5.163s
user 0m0.015s
sys 0m0.015s
time docker pull --quiet alpine
docker.io/library/ubuntu:latest
real 0m0.906s
user 0m0.017s
sys 0m0.013s |
Reading the ticket here; I guess the request is not when a last pull actually happened, but when it was last checked (which could be "checked, but nothing to do"), so possibly slightly different. That's what's made me slightly wonder if there's things to do to make |
this is actually what metadata reports. Attempt to pull, even image is up to date, will change LastTagTime in metadata:
|
Just to knowledge Ideas: Code Changes: Updated Docs: |
@ndeloof Sorry to bother you, I have one more question. Could you clarify the publication flow for Docker Compose across repositories and how it aligns with Docker Desktop updates? Specifically, how does the process work for updating documentation like this link: Thanks in advance! |
Docker Desktop is released monthly and we use to release Compose ~one week before to get the last fixes/and features in |
Thank Youu @ndeloof |
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?
pull_policy: always
forces a docker pull on every docker compose up, even when there’s nothing new to update.🛠 Proposed Solution
Introduce a time-based pull_policy, such as:
Other possible values:
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
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
The text was updated successfully, but these errors were encountered: