title: How to run a docker run command from Jenkinsfile shell if the command contains a "-"?
body: <p>Currently I am trying to run the following command using <code>sh</code> from  Jenkinsfile</p>
  <pre><code>sh &quot;docker run -e key1=${value1} -e key2=\\'run-cli --users ${USERS} --names ${NAMES}\\' -i -t --network host ${DOCKER_HOST}/path/image:tag&quot;
  </code></pre>
  <p>However, it fails with <code>unknown flag: --users</code> each time. It seems like docker isn't treating it as an env variable but instead reading it as a part of its command. I tried every possible combination of quotes and escape sequences but it doesn't work. It runs perfectly fine when running it directly in the console, but fails when running through jenkins. Any workaround to get this working?</p>