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: Cannot pull images without starting and stopping stopped containers #12

Closed
abeluck opened this issue Aug 30, 2020 · 4 comments · Fixed by #119
Closed
Labels
docker-compose-v1 Docker Compose v1

Comments

@abeluck
Copy link

abeluck commented Aug 30, 2020

SUMMARY

As @slavik57 wrote

Currently there is no way to pull the images without starting the containers.
When running with state:absent and pull:true it won't pull the images.
When running with state:present and pull:true and stopped:yes it will pull the images, start the containers and then stop them.
This may cause some unwanted behaviour such as volume creation if there is a local volume mapping.

From: ansible/ansible#31924

ISSUE TYPE
  • Bug Report
COMPONENT NAME

docker_compose

ANSIBLE VERSION

2.x

OS / ENVIRONMENT

All

See previous discussion at ansible/ansible#31924

It is my (@abeluck) opinion that we should maintain backwards compatibility. And so state: present and stopped: true and pull: true should effectively dun docker-compose up --no-start --pull. And if any services are already stopped, then stop them.

@ansibullbot
Copy link

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@sluther
Copy link

sluther commented Aug 30, 2020

This was discussed in an old issue (ansible/ansible#31924) before all of the modules got migrated to this repository.

We discussed fixing this by addressing the issue with stopped: true where it is incorrectly starting containers that aren't running.

@tonal
Copy link
Contributor

tonal commented Oct 8, 2020

Correct cmd-line analogs for

docker_compose: {state: present, stopped: true, pull: true}

mast be

# docker-compose pull && docker-compose up --no-start

@gundalow gundalow transferred this issue from ansible-collections/community.general Oct 30, 2020
@felixfontein felixfontein added the docker-compose-v1 Docker Compose v1 label Jan 2, 2021
tonal added a commit to tonal/community.docker that referenced this issue Apr 6, 2021
felixfontein added a commit that referenced this issue May 4, 2021
* fix #12

* Create 12-correct_pull_wo_starting.yaml

* Update changelogs/fragments/12-correct_pull_wo_starting.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/12-correct_pull_wo_starting.yaml

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update docker_compose.py

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker-compose-v1 Docker Compose v1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants