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
docker-compose up doesn't pull down latest image if the image exists locally #3574
Comments
Is there a reason why |
I think most of the points for/against are the same as the ones discussed in the issue for adding |
I'm trying to execute "docker-compose build", but it doesn't refresh the image referenced in the Dockerfile, except when you use --pull. You can also build containers during the start with up --build. But the newest images will not be pulled. Can we expect sthg like "docker-compose up --build --pull" (or similar)? Maybe it makes sense to place it in the YML since not all build must be refreshed (cfr. local images). |
Instead of (or in addition to) adding --pull to the cli, what about adding something on the service definition in the docker-compose file?, e.g.
This way if there's a service I don't care about being latest and one I do, docker-compose won't waste time downloading images I'm not interested in |
I came here looking for this feature because we use it in our production cluster of Kubernetes. There the tag is "imagePullPolicy" and it can be set to "IfNotPresent", "Always", or "Never." Something similar for a compose environment would be nice. |
In our case, we need to rebuild base image everyday to make sure the latest dependencies updated for applications. Docker compose up to pull the latest image with the same tag is a nice feature. Why not ! |
Any news about this? |
Hi, Any news about this issue? |
+1 |
1 similar comment
+1 |
As I mentioned earlier, |
Imagine that git didn't have |
Adding a |
+1 |
One scenario in which |
We have a scenario in which we develop locally and we would only want to pull some of the images from remote. The one (or more) developed locally should remain untouched. In that case we are obligated to build/pull images manually before running docker-compose up. |
@shin- what about rethinking your decision on this? I believe comments and reactions to them look self-descriptive enough. |
No, I'm good. This is an open-source project, if you disagree with the conservative approach we take when adding features, you're welcome to fork it. |
Agree on adding either a flag to the I actually hit this thread after my colleague was checking my pull request and said it broke the build. And the reason being is that the base image was simply missing a couple of packages - but got executed in the final Dockerfile. It would be a good feature, but apparently not something you used, @shin- . We'd be happy if you introduce this feature in the new version. |
@shin- I think @blockloop showed with the I totally understand the conservative approach but it feels like it is not even considered as an option anymore. Maybe it can be part of an upcoming version? |
A
|
@shin- you keep asking for a reason why the && method wont cut it, and my reason is this. I use it for a "app" image for testing (Puppet PDK/Onceover). The compose file is part of the template repo so when a puppet dev (really ops folks) needs to make a new module they fork that repo. Jenkins runs the image for merge validation on that module repo (internally we have a jenkins plugin that handles the update for the jobs.) Now the folks who use this wont be docker experts, and having to tell them to do the && is an extra step that they can (and probably will) screw up. I dont see why it would be hard or what disadvantage it would create but this reasoning seems like a worthwhile reason to add it. It helps us developers send things out that require less directions and steps.. the short of it is.... to protect against laziness |
Here is better reason: |
@shin is assuming one's using for ourselves on a very rare basis with rare updating Dockerfiles. it's the killer reason why I can't use docker-compose and need to write wrapper scripts with legacy docker run commands , but that's ugly. |
Trying to figure the circumstances under which this ticket was closed - would someone please elaborate? If it's any help, I am pro adding a |
So, here's a good use case: I implemented a CI for my microservices project, which pulls new images to a registry when we develop new features in the backend service. The frontend team (which knows little about docker) needs to have a way to bring up the entire backend stack on their local machines, and they rely on the most updated images. If something breaks, only then they will remember to pull the images. Now this is what happened: An entire development sprint went to fail because someone forgot to update the backend images, and developed an entire feature based on an old version. Blame on frontend team, but this could be avoided with this functionality (which I'll be doing using wrapper scripts). |
@agnjunio That sounds really unfortunate, sorry. However, if the person forgot to run |
@shin- Sorry, I forgot to mention an important thing: The solution in my case is to have the tag |
@ET-CS from #3574 (comment):
AFAIK that would block the use case with a build using a FROM that is the result of a
I'm in favor of a flag as suggested in #3574 (comment) and #3574 (comment) |
@solsson |
@shin- The difference here would be that if I run
Cordially |
One of the main reasons we use docker-compose is the ability to place a We use several services within our docker-compose files that perform tasks like running codegen and running a tool to dereference a JSON schema in to a single file. Having the ability to place: services:
codegen:
image: myimage:latest
pull: Always would retain our ability to have a developer reliably run docker-compose up and get expected results, rather than having to supplement every single repository with documentation to remind developers to run a chain of commands or scripts to pull the latest availabe images before starting the apps. It's not about "the functionality already exists to do this by running these commands", it's a better user experience. Imagine when someone suggested adding |
This thread has been raised 2years ago and I still thought that adding a flag in the docker-compose.yml is the best way. In my case, we have like 37 services in a swarm, and updating 4-5 images from that total is not easy. I just created a shell for now that can monitor the change from the repository and do the pull for the specific image before recreating the service if it has been updated. |
Another point here is that |
Two years of people trying to convince the Docker Compose maintainers that having a --pull option would be a better experience without having to run a separate command. If the docker-compose maintainers just implemented the feature, to begin with, everyone's lives would be better. It seems to be clear that the current maintainers don't want to add this feature for the betterment of the community. Maybe we should just fork docker-compose and update it ourselves. |
If someone were to submit a PR, would it stands a chance if being accepted?
This is open source. I've been close to looking into implementing it a few
times myself. I assume it could be accepted, otherwise this role be closed,
right?
|
I ran into this same issue and holy crap, a bunch of whiners in here. This is FREE open source software. Give the maintainers a break. I'm sure they have much more important things to work on than this. If anyone needs this so badly, why don't you open a PR? If the code is clean with minimal risk, I don't see why they wouldn't accept it. |
This issue should be re-opened since the discussion lacks a good reason to not implement this request. People are more likely to start working on open issues rather than closed ones. |
The fact that this "closed" issue has remained so active does suggest that it has not been handled well. Unfortunately, I've found that responses to issue posts on some GitHub repos are not very helpful. The tone is often terse, and suggests that feedback is less than welcome. Some have pointed out here that this is an open-source project, and (at least most of us) aren't paying customers. However, it's also worth noting that submitting issue reports constitutes a significant time investment, even more so if you participate in the issue's resolution. A user or developer, having spent time troubleshooting a problem, and found a workaround, will then decide if they want to spend additional time to report it. An unreceptive response from maintainers will likely result in them opting not to bother the next time around. The software is not really "FREE", in the "free beer" sense. as we're all trying to participate in making it better. Having people willing to test your software and provide feedback is a valuable resource. Those with the requisite programming skills are even willing to contribute code, but they want some kind of indication that their contributions are welcome before spending time on it. Obviously, comments that simply complain about a problem and demand that it be fixed aren't useful, but the majority aren't doing that, and comments like "it's open source, just fork it" are equally useless. |
@shin- Why was "--build" implemented? Is it different than docker-compose build && docker-compose up? Just trying to understand the philosophical different between --build (which got added) and --pull (which has been deemed redundant). Understanding the thought process might help me remember how things work. AND if the issue is opened, I'm happy to submit a PR. @EverybodyElse... is it really the "spirit of opensource" that if you don't like something you fork? I thought the spirit of opensource was "if you don't like something you a) help contribute to the requirements if that's where you are, b) help contribute to the code if you can" and that you only forked if your requirements were very clearly something only you would benefit from. ie I thought we benefit most when we share - but I'm happy to be educated here. |
After two years of insisting, giving good reasons that are ignored and enormous community support towards having this actually implemented, I would say that this feature won't make it just because @shin- doesn't want to. No reason to keep insisting. |
There is one reason: docker won't refresh the images if one pull fails and there is no good reason not to do it. |
I am looking for the kubernetes image pull policy in docker compose, would be great if the "pull" can be used. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Locking as this keeps getting derailed. We'll re-evaluate depending on the fate of docker/cli#1498 |
As an update, we've decided internally to look into adding a |
It would be nice if there were an option to check for new versions of images when running
docker-compose up
.We already have this functionality with
docker build --pull
as was discussed here moby/moby#4238 and there is an open issue to bring--pull
todocker run
here moby/moby#13331.I propose adding
--pull
toup
to always attempt to pull a newer version of the images in the compose file.The text was updated successfully, but these errors were encountered: