What do the curly braces mean in docker inspect –format “{{.State.Pid}}”?

I’m looking through this shell script and I’m curious what the double curly braces are doing in this line:


  • Is there a way to make the Docker Splunk Driver send the EC2 Instance Id to Splunk when it runs on the AWS EC2 Container Service (ECS)?
  • installation of nodejs returned a non-zero code: 1 with docker build
  • Publishing a message to Kafka running inside docker
  • Custom Docker Repository URL for Artifactory and Jenkins
  • What is the different between putting a separate service discovery and integrate it into the cluster machine in Docker Swarm
  • How do I attach to an existing docker-machine (Azure)?
  • I know that curly braces in shell are used for grouping, but what does two sets of curly braces do? If someone could explain this:

    docker inspect --format "{{.State.Pid}}"

    I would really appreciate it.

  • HTTPS server in Docker container
  • Docker: base image
  • Set up swarm mode Docker Swarm using Vagrant
  • docker-compose tries to pull already existing images
  • How do I configure “ulimits” for a Docker container running in AWS ECS?
  • How to use env var in WORKDIR stanza?
  • One Solution collect form web for “What do the curly braces mean in docker inspect –format “{{.State.Pid}}”?”

    The context of this was a command running

    docker inspect --format "{{.State.Pid}}"

    The Docker option --format takes a go template. Double-curly-braces are meaningful in Go templates, not in bash.

    See the Go text.template package documentation for details. To quote from same:

    “Actions”–data evaluations or control structures–are delimited by “{{” and “}}”; all text outside actions is copied to the output unchanged.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.