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: pull latest image for deploying docker compose buildpack #4686

Closed
wants to merge 1 commit into from

Conversation

tflanagan
Copy link

Changes

  • Pull latest images when using docker compose buildpacks to deploy application

Issues

I've been modifying the container manually to fix this for my own use of Coolify, but I figured I'd push it upstream and see what happens.

(not a docker expert)

@djsisson
Copy link
Contributor

@tflanagan have you tested this?

im curious for a couple of reasons, first , what would pulling an image before its been built do?
the very next section does a build command with --pull anyway
unless you run custom build commands?

the next reason is, the uuid of the image being build is always the projectid, so i never see more than one image in images list, as they all have same id-name:latest
so i dont see this issue

so i assume you are using custom buuild commands and not passing the project name, so it generates a new one each time, hence the multiple images

@tflanagan
Copy link
Author

@djsisson Yes, I use this modification in my local Coolify instance. Just to reiterate, I am not a Docker expert, I could very well be using the service incorrectly.

I noticed the --pull in the subsequent command, but it seemingly does nothing (for me).

We are building and pushing a new docker image with the "latest" tag to a private registry. Without this modification, any deployments will reuse existing, local images without pulling any updates from the registry. The only work around without this modification is to stop the service and manually trigger a clean up on the server.

With this change, I see the attempt to pull the latest image. If the image hasn't changed, this command does nothing as the images will be detected as having been "pulled". If the image has changed, I see the downloading of the new image in the deployment logs.

--

I'm not sure I follow your second paragraph.

I am not using a Custom Build command. Without exposing anything, this is a "Docker Compose" build pack without any custom build or start commands.

@djsisson
Copy link
Contributor

djsisson commented Dec 30, 2024

@tflanagan if your compose is just using an image from a local repository, then set pull_policy: always for that service in the compose.

the issue i believe is this alteration will cause issues for people building images in their compose

@tflanagan
Copy link
Author

@djsisson Thank you for correcting my misuse!

@tflanagan tflanagan closed this Dec 31, 2024
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.

2 participants