title: Simple docker-compose to execute a Jar
body: <p>I am trying to set up a very simple Docker container, that will execute a Jar file.  I want an image that will run a simple Jar.  I dont need anything else special.</p>
  
  <p>So far my docker-compose.yml looks like this, but it doesn't start correctly:</p>
  
  <pre><code>version: "3.3"
  
  services:
    myapp:
      image: openjdk:8
      container_name: "myapp"
      restart: always
      ports:
        - 8091:8091
      volumes:
        - "./meanwhile-in-hell.jar:/app.jar"
      command: ['java', '-jar', '/app.jar']
  </code></pre>
  
  <pre><code>STATUS
  Restarting (1) 2 seconds ago
  </code></pre>
  
  <p>Using the <code>command: ['java', '-jar', '/app.jar']</code> option, I see this in the Docker logs:</p>
  
  <pre><code>Error: Invalid or corrupt jarfile /app.jar
  </code></pre>
  
  <p>If I change to use <code>entrypoint: [ "sh", "-c", "java  -jar /app.jar" ]</code>, I see the same error.</p>
  
  <p>The Jar file is absolutely fine and not corrupt.  I have run it manually on another <code>tomcat:8-alpine</code> container I have running and it starts up successfully. </p>