title: How to pass docker container arguments when running the image in a Jenkinsfile
body: <p>I have a Dockerfile that ends with</p>
  
  <pre><code>ENTRYPOINT ["node", "index.js"]
  CMD ["--help"]
  </code></pre>
  
  <p>The <code>index.js</code> can take a couple different arguments and I also need to expose a port for the container so if I run it manually I do something like:</p>
  
  <pre><code>docker run -p 3000:3000 my_container:latest --arg1 somearg --arg2 anotherarg
  </code></pre>
  
  <p>How do I do this in a Jenkinsfile? My test will communicate with this container so it needs to be running before I run the test. I use <code>withRun()</code> get it running before the test runs but I don't see how to specify the <code>--arg1 somearg --arg2 anotherarg</code></p>
  
  <pre><code>stage('TestMicroservice') {
      //
      // HOW DO I SPECIFY '--arg1 somearg --arg2 anotherarg'?
      //
      docker.image("my_container:latest").withRun('-p 3000:3000') {
          sh 'npm run test-microservice'
      }
  }
  </code></pre>