title: HTTP 500 Internal Server Error : while containerizing my java web app
body: <p>I am containerising my java web app, I am using spotify plugin to do so and using maven to build my project. But when I run <code>mvn clean package docker:build</code> it shows this error :</p>
  
  <p><strong>alesblaze</strong> is my docker hub's username</p>
  
  <p><strong>Bookstore</strong> is my project's name</p>
  
  <blockquote>
    <p>[ERROR] Failed to execute goal
    com.spotify:docker-maven-plugin:1.0.0:build (default) on project
    Bookstore: Exception caught: Request error: POST
    <a href="http://localhost:2375/build?t=alesblaze%2FBookstore" rel="nofollow noreferrer">http://localhost:2375/build?t=alesblaze%2FBookstore</a>: 500, body:
    {"message":"invalid reference format: repository name must be
    lowercase"}: HTTP 500 Internal Server Error</p>
  </blockquote>
  
  <p>Dockerfile</p>
  
  <pre><code>FROM tomcat:8.5-alpine
  EXPOSE 8080
  VOLUME /volume/webapp/
  COPY /target/BookStore-1.war /usr/local/tomcat/webapps/app.war
  RUN sh -c 'touch /usr/local/tomcat/webapps/app.war'
  ENTRYPOINT ["sh", "-c" , "java -Djava.security.edg=file:/dev/./urandom -jar /usr/local/tomcat/webapps/app.war]
  
  </code></pre>
  
  <p>Pom.xml</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;net.codejava.javaee.bookstore&lt;/groupId&gt;
    &lt;artifactId&gt;Bookstore&lt;/artifactId&gt;
    &lt;version&gt;1&lt;/version&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;properties&gt;
      &lt;docker.image.prefix&gt;alesblaze&lt;/docker.image.prefix&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet.jsp-api&lt;/artifactId&gt;
              &lt;version&gt;2.3.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;jstl&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.30&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;  
  
    &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.5.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.8&lt;/source&gt;
            &lt;target&gt;1.8&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
          &lt;configuration&gt;
          &lt;finalName&gt;BookStore&lt;/finalName&gt;
            &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
            &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
  
        &lt;plugin&gt;
      &lt;groupId&gt;com.spotify&lt;/groupId&gt;
      &lt;artifactId&gt;docker-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.0.0&lt;/version&gt;
      &lt;configuration&gt;
      &lt;imageName&gt;${docker.image.prefix}/${project.artifactId}&lt;/imageName&gt;
      &lt;dockerDirectory&gt;Docker&lt;/dockerDirectory&gt;
      &lt;dockerHost&gt;http://localhost:2375&lt;/dockerHost&gt;
      &lt;forceTags&gt;true&lt;/forceTags&gt;
      &lt;imageTags&gt;
      &lt;imageTag&gt;${project.version}&lt;/imageTag&gt;
      &lt;imageTag&gt;latest&lt;/imageTag&gt;
      &lt;/imageTags&gt;
      &lt;serverId&gt;docker-hub&lt;/serverId&gt;
      &lt;registryUrl&gt;https://hub.docker.com/&lt;/registryUrl&gt;
      &lt;resources&gt;
      &lt;resource&gt;
      &lt;targetPath&gt;/&lt;/targetPath&gt;
      &lt;directory&gt;${project.build.directory}&lt;/directory&gt;
      &lt;include&gt;${project.build.finalName}.war&lt;/include&gt;
      &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
      &lt;execution&gt;
      &lt;phase&gt;package&lt;/phase&gt;
      &lt;goals&gt;
      &lt;goal&gt;build&lt;/goal&gt;
      &lt;/goals&gt;
      &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  
  </code></pre>