You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE REQUEST] Add GO templating capabilities to images and/or list commands #12948
There are situations where I'd like to down all projects and this requires access to all project names in a machine readable format.
Given that several docker CLI/compose commands provide templating capabilities with the --format flag I'd expect to solve this with:
docker compose ls --format '{{.Name}}'| xargs -I{} docker compose -p {} down
But docker compose ls --format <format> only offers json or table format therefore it's only possible to get project names using external applications.
If using table format you'd have to hack a shell pipeline.
docker compose ls | tail -n +2 | awk '{print $1}'| xargs -I{} docker compose -p {} down
If using json format, even though json is machine readable, it requires you to pipe to a parser, such as jq, which very likely it's not available.
docker compose ls --format json | jq '.[].Name'| xargs -I{} docker compose -p {} down
The docker CLI and compose already provide GO Templates formatting for several commands such as:
docker ps --format <TEMPLATE>
docker images --format <TEMPLATE>
docker stats --format <TEMPLATE>
docker compose ps --format <TEMPLATE>
The list goes on.
In compose there is compose images and compose ls which not only are not able to handle Templates but they also print JSON in a different way than the ones that support Templates.
The commands that have support print each object as a separate JSON in a different line, while the ones that don't print a JSON list in a single line:
changed the title [-][FEATURE] Add go templating capabilities to images and/or list commands[/-][+][FEATURE] Add GO templating capabilities to images and/or list commands[/+]on Jun 16, 2025
changed the title [-][FEATURE] Add GO templating capabilities to images and/or list commands[/-][+][FEATURE REQUEST] Add GO templating capabilities to images and/or list commands[/+]on Jun 16, 2025
Activity
[-][FEATURE] Add go templating capabilities to images and/or list commands[/-][+][FEATURE] Add GO templating capabilities to images and/or list commands[/+][-][FEATURE] Add GO templating capabilities to images and/or list commands[/-][+][FEATURE REQUEST] Add GO templating capabilities to images and/or list commands[/+]