title: How can I expose a docker port when running a container?
body: <p>I'm using the following Docker version</p>
  
  <pre><code>Docker version 19.03.8, build afacb8b
  </code></pre>
  
  <p>I'm building my image using the following command</p>
  
  <pre><code>docker build -f my.Dockerfile .
  </code></pre>
  
  <p>which tells me</p>
  
  <pre><code>Successfully built 367dc883875e
  </code></pre>
  
  <p>How do I run the above image and expose port 3000?  I tried this</p>
  
  <pre><code>docker run -p localhost:3000:3000 367dc883875e
  docker: invalid publish opts format (should be name=value but got 'localhost:3000:3000').
  See 'docker run --help'.
  </code></pre>
  
  <p>but get the error you see above.</p>