You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: post/dockerize-spring-boot/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@
42
42
> real 0m7,640s
43
43
</code></pre></div><p>So even a single change could cause the jar to be re-built and copied again. We are obviously not using the benefits of docker layers.</p><p>Can’t we leverage other people’s work rather than trying to come up with most optimal <code>Dockerfile</code> ourself?</p><h2id=use-buildpacks>Use Buildpacks</h2><p>Many of the problems that I mentioned previously comes from that the fact that we wrote our <code>Dockerfile</code> manually. So let’s look another approach which does not need any Dockerfile at all.</p><p><ahref=https://buildpacks.io/>Buildpacks</a> transform the source code into containers without Dockerfiles. There are multiple projects that implements the Cloud Native Buildpacks (CNBs) <ahref=https://github.com/buildpacks/spec>spec</a> and probably best two options for java application today is:
44
44
<ahref=https://paketo.io/>Paketo</a> and <ahref=https://github.com/GoogleContainerTools/jib>Jib</a>.</p><h3id=paketo>Paketo</h3><p>We can use paketo by executing the following gradle (or maven) task:</p><divclass=highlight><prestyle=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><codeclass=language-gradledata-lang=gradle><spanstyle=color:#f92672>./</span>gradlew bootBuildImage
45
-
</code></pre></div><p>The task will look at your files, configurations and create a docker image based on the result of the analyses. It’s output is really user friendly and show all the parameters that it used for building the image.</p><divclass=highlight><prestyle=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><codeclass=language-bashdata-lang=bash>> Task :bootBuildImage
45
+
</code></pre></div><p>The task will look and analyze your files, configurations and create a docker image based on it. The task’s output is really user friendly and show all the parameters that it used for building the image.</p><divclass=highlight><prestyle=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><codeclass=language-bashdata-lang=bash>> Task :bootBuildImage
46
46
Building image <spanstyle=color:#e6db74>'docker.io/library/dockerize-spring-boot:0.0.1-SNAPSHOT'</span>
</code></pre></div><p>The task will look at your files, configurations and create a docker image based on the result of the analyses. It&rsquo;s output is really user friendly and show all the parameters that it used for building the image.</p>
70
+
</code></pre></div><p>The task will look and analyze your files, configurations and create a docker image based on it. The task&rsquo;s output is really user friendly and show all the parameters that it used for building the image.</p>
</code></pre></div><p>The task will look at your files, configurations and create a docker image based on the result of the analyses. It&rsquo;s output is really user friendly and show all the parameters that it used for building the image.</p>
70
+
</code></pre></div><p>The task will look and analyze your files, configurations and create a docker image based on it. The task&rsquo;s output is really user friendly and show all the parameters that it used for building the image.</p>
</code></pre></div><p>The task will look at your files, configurations and create a docker image based on the result of the analyses. It&rsquo;s output is really user friendly and show all the parameters that it used for building the image.</p>
70
+
</code></pre></div><p>The task will look and analyze your files, configurations and create a docker image based on it. The task&rsquo;s output is really user friendly and show all the parameters that it used for building the image.</p>
</code></pre></div><p>The task will look at your files, configurations and create a docker image based on the result of the analyses. It&rsquo;s output is really user friendly and show all the parameters that it used for building the image.</p>
70
+
</code></pre></div><p>The task will look and analyze your files, configurations and create a docker image based on it. The task&rsquo;s output is really user friendly and show all the parameters that it used for building the image.</p>
0 commit comments