title: How to reduce docker image size for Java application
body: <p>i have the following dockerfile code but the image with over 500mb is way to large. I tried to use multi stage build in order so reduce the size but after that the kubernetes deployment wont work.</p>
  <pre><code>FROM openjdk:8
  ADD target/name_id.jar name_id.jar
  EXPOSE 8080
  ENTRYPOINT [ &quot;java&quot;,&quot;-jar&quot;,&quot;name_id.jar&quot; ]
  </code></pre>
  <p>With this file it works. Can someone help me?
  For the project itself maven and springboot are used. I also have to clean install the jar everytime if i change something in the code.</p>