title: docker: invalid reference format in shell script
body: <p>I'm trying to create a shell script to run a docker container and am struggling. My script is like this:</p>
  
  <pre><code>#!/bin/bash
  
  if [ "$1" == "" ]; then
      echo "Usage &gt; run.sh IMAGE NAME"
      echo
      echo "i.e. ./build.sh cd2:0.0.49"
      exit
  fi
  
  echo $1
  
  docker run -it --rm \
  -e NODE_PATH='./src'\
  -e NODE_HOST='0.0.0.0'\
  -e NODE_ENV='production'\
  -e DOCKER=true\
  -e PORT='8080'\
  -e STAGING=true\
  -e SENDGRID_API_KEY='&lt;redacted&gt;'\
  -p 8080:8080 $1
  </code></pre>
  
  <p>When I run: <code>bash run.sh cd2:0.0.50</code></p>
  
  <p>I get: <code>docker: invalid reference format: repository name must be lowercase.</code></p>
  
  <p>Even if I do <code>bash run.sh cd:0.0.50</code> it still fails (<code>echo $1</code> results in <code>cd2:0.0.50</code>).</p>
  
  <p>If I run <code>docker run -it --rm -p 8080:8080 cd2:0.0.50</code> from the command line it works...</p>
  
  <p>Can anyone help?</p>