Advisory: This site contains documentation for the v1.12 release candidate version of Docker Engine. For the Docker Engine v1.11 docs, see Docker for Mac and Docker for Windows are currently in Beta.

Formatting reference

Docker uses Go templates to allow users manipulate the output format of certain commands and log drivers. Each command a driver provides a detailed list of elements they support in their templates:

Template functions

Docker provides a set of basic functions to manipulate template elements. This is the complete list of the available functions with examples:


Join concatenates a list of strings to create a single string. It puts a separator between each element in the list.

$ docker ps --format '{{join .Names " or "}}'


Json encodes an element as a json string.

$ docker inspect --format '{{json .Mounts}}' container


Lower turns a string into its lower case representation.

$ docker inspect --format "{{lower .Name}}" container


Split slices a string into a list of strings separated by a separator.

# docker inspect --format '{{split (join .Names "/") "/"}}' container


Title capitalizes a string.

$ docker inspect --format "{{title .Name}}" container


Upper turms a string into its upper case representation.

$ docker inspect --format "{{upper .Name}}" container