community.docker
community.docker copied to clipboard
Add support for missing docker-compose build parameters
SUMMARY
Many features from the docker-compose build
command are currently missing. It would be pretty useful to get them or at least some of them available in the module.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
docker_compose
ADDITIONAL INFORMATION
See all the option available here: https://docs.docker.com/compose/reference/build/
Of those, only two seems available through the Ansible module: nocache
and pull
, see https://github.com/ansible-collections/community.docker/blob/main/plugins/modules/docker_compose.py#L995.
But considering a single module is both building and managing the docker-compose
services, I guess managing several sets of options can quickly become a mess here?
Thank you for bringing this up. I have privately started working on extracting the compose
functionality so that it could be used across multiple modules. So far I have the following potential modules:
- #24 -
docker_compose_info
- #98 -
docker_compose_exec
- The original
docker_compose
Do you have any ideas about how to best group the compose
options?
For example do you feel like docker_compose_build
has enough functionality to be it's own module?
I honestly don't know, I'm not knowledgeable enough as for the architecture side of those things.
As I was fixing some things the linter was bringing up at $job I wanted to replace the command:
tasks by the appropriate modules for docker-compose, but found out the chdir
was missing, as well as --parallel
and --force-rm
where I wasn't sure if the --remove*
options would cover it.
I thought about adding the option and looked for example at the docker_container
module but found out that much more options were missing and that the different modules seemed to not be structured the same way at all, so I didn't knew what to do starting from there.