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

Add pull option to docker compose build #1613

Merged
merged 1 commit into from
May 31, 2023
Merged

Add pull option to docker compose build #1613

merged 1 commit into from
May 31, 2023

Conversation

lognaturel
Copy link
Member

@lognaturel lognaturel commented May 18, 2023

As of getodk/central#428, we pin all base images to minor versions. The goal is for hosters to get patches at time of upgrade.

I considered adding pull for all the sections in https://docs.getodk.org/central-install-digital-ocean/#advanced-configuration-options and https://docs.getodk.org/central-troubleshooting/ The nice thing with that is there would be more opportunities to get point releases. But all of those are rare so it doesn't seem worth possibly adding a confusing setep.

My understanding is that this is what the `--pull` option for `build` does and that `docker compose pull` would not update base images. https://github.com/docker/compose/issues/2742#issuecomment-180077368

@lognaturel lognaturel requested review from matthew-white and yanokwa and removed request for matthew-white May 18, 2023 19:38
@yanokwa
Copy link
Member

yanokwa commented May 18, 2023

In my testing, docker compose build --pull didn't update anything, but docker compose pull seemed to update a lot.

I think in Upgrade steps, Step 4, should be..

docker compose pull
docker compose build

This is better than what we have now, and we don't have to put pulling everywhere. I sure would like to understand the difference between the commands though.

@lognaturel lognaturel marked this pull request as draft May 18, 2023 23:28
@lognaturel
Copy link
Member Author

Maybe docker-compose build --pull --no-cache would be the same as docker compose pull followed by build?

@yanokwa
Copy link
Member

yanokwa commented May 19, 2023

Bard says...

docker compose pull: Pulls the images for the services defined in the compose file.

  • You might want to use docker compose pull if you are working on a development machine and you want to make sure that you are always using the latest versions of the images for the services that you are developing.

docker compose build --pull: Builds the images for the services defined in the compose file and also pulls any newer versions of the images that are already present on the local machine.

  • You might want to use docker compose build --pull if you are deploying a production application and you want to make sure that you are using the latest versions of the images for the services that are running in production.

@yanokwa
Copy link
Member

yanokwa commented May 19, 2023

https://www.reddit.com/r/docker/comments/13lz580/comment/jkssd7y/ has more information.

I think we need to do both:

  • docker compose pull to update images used in the docker-compose.yml file (e.g., mail)
  • docker compose build --pull to update images used in any Dockerfiles (e.g., nginx)

@lognaturel lognaturel marked this pull request as ready for review May 30, 2023 23:15
@yanokwa yanokwa merged commit 4dd1c27 into master May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ done
Development

Successfully merging this pull request may close these issues.

2 participants