title: How can I get a Docker image's label if the label name has a "." in it?
body: <p>The docker inspect command can be very useful for getting the labels on a Docker image:</p>
  
  <pre><code># -*- Dockerfile -*-
  FROM busybox
  LABEL foo="bar"
  LABEL com.wherever.foo="bang"
  </code></pre>
  
  <p>For simple label names, the inspect command has a <code>--format</code> option (which uses Go templates) that works nicely.</p>
  
  <pre><code>$ docker build -t foo .
  $ docker inspect -f '{{ .Config.Labels.foo }}' foo
  bar
  </code></pre>
  
  <p>But how do I access labels that have a dot in their name?</p>
  
  <pre><code>$ docker inspect -f '{{ .Config.Labels.com.wherever.foo }}' foo
  &lt;no value&gt;
  </code></pre>
  
  <p>I'm writing this in a bash script, where I'd like to avoid re-parsing the JSON output from <code>docker inspect</code>, if possible.</p>