How to use --format option of docker inspect to get its output as a table.
Following the documentation I used --format 'table ...' as an option with docker ps and it worked fine, but docker inspect seems to ignore it.
example:
echo "docker ps as table"
docker ps -a --format 'table {{.Names}}\t{{.Image}}'
echo "docker inspect as table"
docker ps --quiet | xargs --no-run-if-empty docker inspect \
--format 'table {{.Name}}\t{{.Config.Image}}'
produces the output:
docker ps as table
NAMES IMAGE
tmp-php-7.3-cli-buster tmp-php:7.3-cli-buster
tmp-mysql-8.0.19-client mysql:8
tmp-mysql-8.0.19 tmp-mysql:8.0.19
tmp-nginx-1.17.8 tmp-nginx:1.17.8
tmp-php-7.3-fpm-buster tmp-php:7.3-fpm-buster
tmp-node-13.8.0-buster tmp-node:13.8.0-buster
docker inspect as table
table /tmp-php-7.3-cli-buster\ttmp-php:7.3-cli-buster
table /tmp-mysql-8.0.19-client\tmysql:8
table /tmp-mysql-8.0.19\ttmp-mysql:8.0.19
table /tmp-nginx-1.17.8\ttmp-nginx:1.17.8
table /tmp-php-7.3-fpm-buster\ttmp-php:7.3-fpm-buster
table /tmp-node-13.8.0-buster\ttmp-node:13.8.0-buster