title: execute docker commands from bash file
body: <p>How can one run docker commands from a bash (sh) script? I am trying to run:</p>
  
  <pre><code>#!/bin/bash
  container= $(docker ps --format "{{.ID}} {{.Names}}" -a | grep testServer | awk '/'$imid'/ { print $1 }');
  echo $container
  </code></pre>
  
  <p>but I get a blank for the container.</p>
  
  <p>TIA</p>