Accoding to the documentation:
--format , -f
Format output using a custom template: ‘json’: Print in JSON format ‘TEMPLATE’: Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information
about formatting output with templates
And:
Docker uses Go templates which you can use to manipulate the output format of certain commands and log drivers.
So basically it's Go templates syntax that allows you to do some string manipulations, such as:
docker inspect --format '{{json .Mounts}}' container
To format Mounts
field as JSON.
or, this for example:
docker inspect --format "{{upper .Name}}" container
Which transforms Name
to uppercase.
See more: