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:

https://github.com/jpetazzo/nsenter/blob/master/docker-enter#L16

  • Post request with form data raising 400 error in mocha test
  • Docker compose new image and instance
  • Docker Compose Expose Spark Worker UI Ports Dynamically to Host When Scaling
  • Kubernetes: how to use gitRepo volume?
  • Performance: Java in Docker [closed]
  • What is the different between Docker bundles and docker-compose?
  • 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.

  • In docker, why does mounting a data volume container to a container makes it stop working?
  • Docker service failed to start application container engine on CentOS7
  • Installing Gitlab CI using Docker for the Ci and the Runners, and make it persistent after reboot
  • Assigning Public IP to SQL Server Docker Image
  • Cannot save a Spark Model with a Dockerized Spark cluster
  • docker commit fails with “no such id”
  • 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.