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

  • Docker filling up my SSD with containers when I stop an AWS server?
  • Deploy Meteor 1.3, React app on AWS
  • How to connect Mysql Docker to other docker in Dockerfile?
  • Docker - Creating base image with RHEL iso
  • Docker + Nodejs + Private Repo + Private NPM Module - Access Problems
  • Why is Docker Secrets more secure than environment variables?
  • 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.

  • Kuberntes master not starting up in OpenStack heat
  • Docker : How to change the location of directory images in Docker?
  • Change default Docker temp directory to host temp directory
  • Vagrant Error in Centos
  • how to create a volume in docker with filesystem?
  • Run Grunt / Gulp inside Docker container or outside?
  • 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.