Skip to content
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

fix: always pull latest compose file image #5256

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

Patrick3131
Copy link

Changes

  • Always pull latest images if build pack is not docker image

Issues

@djsisson
Copy link
Contributor

@Patrick3131 you can add pull_policy: always to each service where you need the image pulled everytime.

imo forcing this on everyone for every image, doesn't seem great to me

@Patrick3131
Copy link
Author

Hey @djsisson
Thank you for your input.
It makes sense what you are saying.

Here in this PR by @lucienbl we are using a similar approach, the only difference is (correct me if I am wrong) that we are using the server to build and are not just pulling the images from a registry. So to be consistent, we should use the same approach for both use cases, what do you think?

@lucienbl
Copy link
Contributor

lucienbl commented Mar 1, 2025

Hey @djsisson what you say completely makes sense and that was my thought too, however the problem is that AFAIK we do not have 'easy' access to the generated compose file when using Nixpacks, which is the problem here. But maybe having an option to have the force pull or not would be a better solution as each user could choose what he wants.

Could be an option here for example :

image

@djsisson
Copy link
Contributor

djsisson commented Mar 1, 2025

the build server entry suffers from the same issue, you're requesting to repull everything, just means you can easily hit rate limits on external repo hubs.

To clarify, the above fix, means those with a compose file have all their services request a repull, so if its a big stack, that's the issue, for single deployments, this isn't an issue, but below would be the ideal fix.

you would add an entry here for pull_policy: always this works for all paths for only the service that is being built that aren't using a compose file,

'image' => $this->production_image_name,

@lucienbl
Copy link
Contributor

lucienbl commented Mar 1, 2025

That makes sense, thanks for the hint !

@djsisson
Copy link
Contributor

djsisson commented Mar 1, 2025

I will reiterate the first post, if you are using a compose that is using an externally built image, you need to just add

services:
  service:
    image: xxx
    pull_policy: always

this fixes issue of not always pulling your newly built image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants