community.docker icon indicating copy to clipboard operation
community.docker copied to clipboard

Add support for missing docker-compose build parameters

Open Porkepix opened this issue 2 years ago • 2 comments

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: nocacheand 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-composeservices, I guess managing several sets of options can quickly become a mess here?

Porkepix avatar Sep 08 '21 16:09 Porkepix

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:

  1. #24 - docker_compose_info
  2. #98 - docker_compose_exec
  3. 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?

Ajpantuso avatar Sep 08 '21 16:09 Ajpantuso

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.

Porkepix avatar Sep 08 '21 16:09 Porkepix