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

docker-compose up don't respect pull policy #177

Open
samuelbernardolip opened this issue Dec 20, 2021 · 1 comment · May be fixed by #179
Open

docker-compose up don't respect pull policy #177

samuelbernardolip opened this issue Dec 20, 2021 · 1 comment · May be fixed by #179
Assignees
Labels
bug Something isn't working documentation
Milestone

Comments

@samuelbernardolip
Copy link
Collaborator

samuelbernardolip commented Dec 20, 2021

Version 2 releases are only running docker-compose up that only pull images on the first deployment. If an image changes it ignores the pull policy. To solve this issue is required that docker-compose pull runs before docker-compose up.
An example of this solution to solve this issue:
https://github.com/stephanlindauer/docker-compose-updater/blob/master/run.sh

Beside this, is also important in docker-compose.yml file to define the pull_policy property:

# Since 2020-05-07, the docker-compose spec also defines the "pull_policy" property for a service:
version: '3.7'

services:
  my-service:
    image: someimage/somewhere
    pull_policy: always

A reference of this detail would be also important in the documentation. Possible values are defined in docker-compose spec.

@samuelbernardolip samuelbernardolip added bug Something isn't working documentation labels Dec 20, 2021
@samuelbernardolip samuelbernardolip self-assigned this Dec 20, 2021
@samuelbernardolip samuelbernardolip linked a pull request Feb 3, 2022 that will close this issue
2 tasks
@samuelbernardolip
Copy link
Collaborator Author

samuelbernardolip commented Jun 9, 2022

For CI environment, the best approach to force all base images pull again and force build image with native docker, requires the following sequence of commands:

docker-compose rm -f -v -s
docker-compose pull 
docker-compose build --no-cache
docker-compose up -d

and also set

pull_policy: always

in service configuration.

@samuelbernardolip samuelbernardolip added this to the 2.3.0 milestone Jun 10, 2022
@samuelbernardolip samuelbernardolip linked a pull request Jun 10, 2022 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant