title: Why does wildcard for jar execution not work in docker CMD?
body: <p>I have a <code>Dockerfile</code> with the following <code>CMD</code> to start my spring boot app:</p>
  
  <pre><code>FROM java:8-jre
  # ...
  CMD ["java", "-jar", "/app/file*.jar"]
  </code></pre>
  
  <p>When I try to start a container from the created image I get:</p>
  
  <pre><code>Error: Unable to access jarfile /app/file*.jar
  </code></pre>
  
  <p>But when I override the <code>CMD</code> while starting the container and execute the command in the container everything works fine:</p>
  
  <pre><code>docker run -it &lt;imageId&gt; bash
  root@&lt;containerId&gt;:/app# java -jar /app/file*.jar
  &lt;spring boot app starts...&gt;
  </code></pre>
  
  <p>Is it possible to use wildcards with <code>java -jar</code> command using docker CMDs? 
  Please don't tell me not to use wildcards. I want to use it cause of reasons ;-)</p>
  
  <p><strong>Update</strong>
  Based on the answer I was able to fix it:</p>
  
  <pre><code>CMD ["/bin/sh", "-c", "java -jar /app/file*.jar"]
  </code></pre>