{"id":11277,"date":"2021-11-29T20:43:28","date_gmt":"2021-11-29T20:43:28","guid":{"rendered":"https:\/\/exceptionly.com\/?p=11277"},"modified":"2022-06-29T14:00:57","modified_gmt":"2022-06-29T14:00:57","slug":"dockerize-a-spring-boot-application","status":"publish","type":"post","link":"https:\/\/exceptionly.com\/ar\/2021\/11\/29\/dockerize-a-spring-boot-application\/","title":{"rendered":"Dockerize a Spring Boot Application"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"11277\" class=\"elementor elementor-11277\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-0268939 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"0268939\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f3d2321\" data-id=\"f3d2321\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4e0dd37 elementor-widget elementor-widget-text-editor\" data-id=\"4e0dd37\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Starting with this tutorial, I will go through a deployment series of a Java application to various cloud providers.<\/p><p>Before setting up a pipeline and walking you through the deployment process, I want to dockerize an application so we can use this in the deployment process.<\/p><h2>What is Docker, and why do we need to Dockerize an application?<\/h2><p>Docker is a Linux-based container management tool that enables you to create, publish and consume container images.<\/p><p>Containerization of an application with Docker will create a consistent environment in recreating applications and deploying them to the different cloud providers. That commits write once, run anywhere.\u00a0<\/p><ul><li aria-level=\"1\">Containerized apps start and stop very quickly.<\/li><li aria-level=\"1\">Docker helps efficiency when it comes to the usage of system resources<\/li><li aria-level=\"1\">Ability to run on different platforms &amp; cloud providers<\/li><li aria-level=\"1\">Isolation between host system and application<\/li><li aria-level=\"1\">Easy to scale<\/li><\/ul><p>I&#8217;m writing this tutorial with the prerequisites below;<\/p><ul><li aria-level=\"1\">You have Docker installed, up and running!<\/li><\/ul><h2>Dockerize a Spring Boot Application<\/h2><h3>Initialize a Spring Boot Project<\/h3><p>I have already created an elementary Spring Boot application for this tutorial. It provides a simple GET endpoint with \/ping path and returns &#8220;pong&#8221; as a response. You can clone from <a href=\"https:\/\/github.com\/exceptionly\/blog-spring-boot-docker\">Exceptionly\u00a0Github<\/a> account or generate a Spring Boot application with <a href=\"https:\/\/start.spring.io\/\">Spring Initializr<\/a><\/p><p>After we clone the application, build executable jar file by Gradle build task on the left Gradle UI or with .\/gradlew build command from the terminal.<\/p><h3>Containerize Application With Docker<\/h3><p>Docker is building images automatically by executing the instructions from a Dockerfile.\u00a0<\/p><p><a href=\"https:\/\/docs.docker.com\/engine\/reference\/builder\/\">Official Docker Docs<\/a> statement for Dockerfile:<\/p><blockquote><p>A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. Using docker build users can create an automated build that executes several command-line instructions in succession.<\/p><\/blockquote><p>Create the following Dockerfile in the application root folder<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-eb963cf elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"eb963cf\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-695e52e\" data-id=\"695e52e\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-7bf1630 elementor-widget elementor-widget-code-highlight\" data-id=\"7bf1630\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>FROM eclipse-temurin:17\nCOPY build\/libs\/*.jar app.jar\nENTRYPOINT [\"java\",\"-jar\",\"\/app.jar\"]<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-03c7a83 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"03c7a83\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e3b4dee\" data-id=\"e3b4dee\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-66d86b0 elementor-widget elementor-widget-text-editor\" data-id=\"66d86b0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Eclipse Temurin is providing the official OpenJDK binary images. In the above example, we are using Java 17 version.\u00a0<\/p><p>Find the Eclipse Temurin images in the <a href=\"https:\/\/hub.docker.com\/_\/eclipse-temurin?tab=tags\">Docker hub<\/a>.\u00a0<\/p><p>This docker build does the following:<\/p><ol><li aria-level=\"1\">It starts from the Eclipse Temurin official OpenJDK image for Java 17<\/li><li aria-level=\"1\">Copies the Java executable jar inside the container<\/li><li aria-level=\"1\">Configures the container for the instructions in the ENTRYPOINT<\/li><\/ol><p>Run this Dockerfile with the command to build an image;<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-fa1ac4f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"fa1ac4f\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-bf4e4c4\" data-id=\"bf4e4c4\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3b5532f elementor-widget elementor-widget-code-highlight\" data-id=\"3b5532f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>$ docker build -t exceptionly\/demo .<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-8898fa5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"8898fa5\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b64de54\" data-id=\"b64de54\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-0986d26 elementor-widget elementor-widget-text-editor\" data-id=\"0986d26\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>This command will build an image named exceptionly\/demo from the Dockerfile.<\/p><p>Verify built image;\u00a0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-adba28b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"adba28b\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-54837f1\" data-id=\"54837f1\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4a43b8c elementor-widget elementor-widget-code-highlight\" data-id=\"4a43b8c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>$ docker images\nREPOSITORY         TAG       IMAGE ID       CREATED          SIZE\nexceptionly\/demo  latest    bd276cd342d0   15 minutes ago   480MB<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-91fd932 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"91fd932\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f7ea1ec\" data-id=\"f7ea1ec\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2b3ed49 elementor-widget elementor-widget-text-editor\" data-id=\"2b3ed49\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Run the dockerized application container with the following command:<\/p><p>-p binds port 8080 of the container to TCP port 8080 on localhost<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-739ffb5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"739ffb5\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-0959f67\" data-id=\"0959f67\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-314d3bf elementor-widget elementor-widget-code-highlight\" data-id=\"314d3bf\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>$ docker run -p 8080:8080 exceptionly\/demo\n\n:: Spring Boot ::                (v2.6.0)\nStarting DemoApplication using Java 17.0.1 on 755fff7c521e with PID 1 (\/app.jar started by root in \/)\n\u2026\nStarted DemoApplication in 4.249 seconds (JVM running for 4.95)\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b89a126 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b89a126\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-29fe8f3\" data-id=\"29fe8f3\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2d49497 elementor-widget elementor-widget-text-editor\" data-id=\"2d49497\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>List the containers are running currently:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-6f98a0d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"6f98a0d\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ad6a13d\" data-id=\"ad6a13d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-564d792 elementor-widget elementor-widget-code-highlight\" data-id=\"564d792\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>\n$ docker ps\nc13124bf328d   exceptionly\/demo:latest   \"java -jar \/app.jar\"   5 seconds ago   Up 4 seconds   0.0.0.0:8080->8080\/tcp, :::8080->8080\/tcp <\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c87b064 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c87b064\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7d923ea\" data-id=\"7d923ea\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-58aba9d elementor-widget elementor-widget-text-editor\" data-id=\"58aba9d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>The Spring Boot application is up and running in a Docker container. Navigate localhost:8080\/ping endpoint in the browser or curl localhost:8080\/ping from the command line.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2d2d221 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2d2d221\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-9c45b9d\" data-id=\"9c45b9d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-032e8f6 elementor-widget elementor-widget-code-highlight\" data-id=\"032e8f6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>$ curl http:\/\/localhost:8080\/ping\npong<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-00bbac8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"00bbac8\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-01c5dd0\" data-id=\"01c5dd0\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a605b14 elementor-widget elementor-widget-text-editor\" data-id=\"a605b14\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>As always being said; The best way to learn a tool or language is to practice.<\/p><p>Try to dockerize an application that has a different tech stack. Feel free to check out my previous posts to initialize an application if you haven&#8217;t yet!<\/p><ul><li aria-level=\"1\"><a href=\"https:\/\/exceptionly.com\/2021\/07\/07\/how-to-start-coding-java-in-60-minutes\/\">Start Coding Java in 60 minutes<\/a><\/li><li aria-level=\"1\"><a href=\"https:\/\/exceptionly.com\/2021\/09\/14\/how-to-start-coding-vuejs-in-60-minutes\/\">Start Coding VueJS in 60 minutes<\/a><\/li><li aria-level=\"1\"><a href=\"https:\/\/exceptionly.com\/2021\/08\/07\/how-to-start-coding-react-in-60-minutes\/\">Start Coding React in 60 minutes<\/a><\/li><li aria-level=\"1\"><a href=\"https:\/\/exceptionly.com\/2021\/08\/23\/how-to-start-coding-javascript-in-60-minutes\/\">Start Coding JavaScript in 60 minutes<\/a><\/li><li aria-level=\"1\"><a href=\"https:\/\/exceptionly.com\/2021\/10\/17\/how-to-start-coding-angularjs-in-60-minutes\/\">Start Coding AngularJS in 60 minutes<\/a><\/li><li aria-level=\"1\"><a href=\"https:\/\/exceptionly.com\/2021\/07\/21\/how-to-start-coding-python-in-60-minutes\/\">Start Coding Python in 60 minutes<\/a><\/li><li aria-level=\"1\"><a href=\"https:\/\/exceptionly.com\/2021\/11\/02\/how-to-start-coding-node-js-in-60-minutes\/\">Start Coding NodeJS in 60 minutes<\/a><\/li><li><a href=\"https:\/\/exceptionly.com\/2021\/11\/11\/how-to-start-coding-flutter-in-60-minutes\/\">Start Coding Flutter in 60 minutes<\/a><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Starting with this tutorial, I will go through a deployment series of a Java application to various cloud providers. Before setting up a pipeline and walking you through the deployment process, I want to dockerize an application so we can use this in the deployment process. What is Docker, and why do we need to [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":11493,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[138,135,152,150,151,143],"class_list":["post-11277","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-aws","tag-cloud-providers","tag-container","tag-docker","tag-dockerize-spring-boot-application","tag-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v18.5 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Dockerize a Spring Boot Application - Exceptionly<\/title>\n<meta name=\"description\" content=\"Docker is a Linux-based container management tool that enables you to create, publish and consume container images. Containerization of an application with Docker will create a consistent environment in the sense of recreating applications and deploying them to the different cloud providers. That commits write once, run anywhere.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/exceptionly.com\/ar\/2021\/11\/29\/dockerize-a-spring-boot-application\/\" \/>\n<meta property=\"og:locale\" content=\"ar_AR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dockerize a Spring Boot Application\" \/>\n<meta property=\"og:description\" content=\"Starting with this tutorial, I will go through a deployment series of a Java application to various cloud providers. Before setting up a pipeline and\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceptionly.com\/ar\/2021\/11\/29\/dockerize-a-spring-boot-application\/\" \/>\n<meta property=\"og:site_name\" content=\"Exceptionly\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/exceptionly\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-29T20:43:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-29T14:00:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/11\/dockerize-a-spring-boot-application.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1930\" \/>\n\t<meta property=\"og:image:height\" content=\"766\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Fatma Elverir\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@exceptionly\" \/>\n<meta name=\"twitter:site\" content=\"@exceptionly\" \/>\n<meta name=\"twitter:label1\" content=\"\u0643\u064f\u062a\u0628 \u0628\u0648\u0627\u0633\u0637\u0629\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatma Elverir\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u0648\u0642\u062a \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0627\u0644\u0645\u064f\u0642\u062f\u0651\u0631\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u062f\u0642\u0627\u0626\u0642\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/\"},\"author\":{\"name\":\"Fatma Elverir\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/person\\\/a2600170dfb4513350affede916c0ccf\"},\"headline\":\"Dockerize a Spring Boot Application\",\"datePublished\":\"2021-11-29T20:43:28+00:00\",\"dateModified\":\"2022-06-29T14:00:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/\"},\"wordCount\":539,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/dockerize-a-spring-boot-application.jpg\",\"keywords\":[\"AWS\",\"Cloud Providers\",\"container\",\"Docker\",\"Dockerize Spring Boot Application\",\"Java\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"ar\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/\",\"name\":\"Dockerize a Spring Boot Application - Exceptionly\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/dockerize-a-spring-boot-application.jpg\",\"datePublished\":\"2021-11-29T20:43:28+00:00\",\"dateModified\":\"2022-06-29T14:00:57+00:00\",\"description\":\"Docker is a Linux-based container management tool that enables you to create, publish and consume container images. Containerization of an application with Docker will create a consistent environment in the sense of recreating applications and deploying them to the different cloud providers. That commits write once, run anywhere.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/#breadcrumb\"},\"inLanguage\":\"ar\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/#primaryimage\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/dockerize-a-spring-boot-application.jpg\",\"contentUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/dockerize-a-spring-boot-application.jpg\",\"width\":1930,\"height\":766,\"caption\":\"Dockerize a Spring Boot Application\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/11\\\/29\\\/dockerize-a-spring-boot-application\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/exceptionly.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Dockerize a Spring Boot Application\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#website\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/\",\"name\":\"Exceptionly\",\"description\":\"Remote software talent acquisition at scale\",\"publisher\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/exceptionly.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ar\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#organization\",\"name\":\"Exceptionly\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/exceptionly-search-logo.png\",\"contentUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/exceptionly-search-logo.png\",\"width\":400,\"height\":400,\"caption\":\"Exceptionly\"},\"image\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/exceptionly\\\/\",\"https:\\\/\\\/x.com\\\/exceptionly\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/exceptionly\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCet5wATTyif6knI0h4vUkNA\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/person\\\/a2600170dfb4513350affede916c0ccf\",\"name\":\"Fatma Elverir\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g\",\"caption\":\"Fatma Elverir\"},\"sameAs\":[\"https:\\\/\\\/exceptionly.com\"],\"url\":\"https:\\\/\\\/exceptionly.com\\\/ar\\\/author\\\/fatmaelverir\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Dockerize a Spring Boot Application - Exceptionly","description":"Docker is a Linux-based container management tool that enables you to create, publish and consume container images. Containerization of an application with Docker will create a consistent environment in the sense of recreating applications and deploying them to the different cloud providers. That commits write once, run anywhere.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/exceptionly.com\/ar\/2021\/11\/29\/dockerize-a-spring-boot-application\/","og_locale":"ar_AR","og_type":"article","og_title":"Dockerize a Spring Boot Application","og_description":"Starting with this tutorial, I will go through a deployment series of a Java application to various cloud providers. Before setting up a pipeline and","og_url":"https:\/\/exceptionly.com\/ar\/2021\/11\/29\/dockerize-a-spring-boot-application\/","og_site_name":"Exceptionly","article_publisher":"https:\/\/www.facebook.com\/exceptionly\/","article_published_time":"2021-11-29T20:43:28+00:00","article_modified_time":"2022-06-29T14:00:57+00:00","og_image":[{"width":1930,"height":766,"url":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/11\/dockerize-a-spring-boot-application.jpg","type":"image\/jpeg"}],"author":"Fatma Elverir","twitter_card":"summary_large_image","twitter_creator":"@exceptionly","twitter_site":"@exceptionly","twitter_misc":{"\u0643\u064f\u062a\u0628 \u0628\u0648\u0627\u0633\u0637\u0629":"Fatma Elverir","\u0648\u0642\u062a \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0627\u0644\u0645\u064f\u0642\u062f\u0651\u0631":"3 \u062f\u0642\u0627\u0626\u0642"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/#article","isPartOf":{"@id":"https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/"},"author":{"name":"Fatma Elverir","@id":"https:\/\/exceptionly.com\/#\/schema\/person\/a2600170dfb4513350affede916c0ccf"},"headline":"Dockerize a Spring Boot Application","datePublished":"2021-11-29T20:43:28+00:00","dateModified":"2022-06-29T14:00:57+00:00","mainEntityOfPage":{"@id":"https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/"},"wordCount":539,"commentCount":4,"publisher":{"@id":"https:\/\/exceptionly.com\/#organization"},"image":{"@id":"https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/#primaryimage"},"thumbnailUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/11\/dockerize-a-spring-boot-application.jpg","keywords":["AWS","Cloud Providers","container","Docker","Dockerize Spring Boot Application","Java"],"articleSection":["Tutorials"],"inLanguage":"ar","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/","url":"https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/","name":"Dockerize a Spring Boot Application - Exceptionly","isPartOf":{"@id":"https:\/\/exceptionly.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/#primaryimage"},"image":{"@id":"https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/#primaryimage"},"thumbnailUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/11\/dockerize-a-spring-boot-application.jpg","datePublished":"2021-11-29T20:43:28+00:00","dateModified":"2022-06-29T14:00:57+00:00","description":"Docker is a Linux-based container management tool that enables you to create, publish and consume container images. Containerization of an application with Docker will create a consistent environment in the sense of recreating applications and deploying them to the different cloud providers. That commits write once, run anywhere.","breadcrumb":{"@id":"https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/#breadcrumb"},"inLanguage":"ar","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/"]}]},{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/#primaryimage","url":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/11\/dockerize-a-spring-boot-application.jpg","contentUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/11\/dockerize-a-spring-boot-application.jpg","width":1930,"height":766,"caption":"Dockerize a Spring Boot Application"},{"@type":"BreadcrumbList","@id":"https:\/\/exceptionly.com\/2021\/11\/29\/dockerize-a-spring-boot-application\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/exceptionly.com\/"},{"@type":"ListItem","position":2,"name":"Dockerize a Spring Boot Application"}]},{"@type":"WebSite","@id":"https:\/\/exceptionly.com\/#website","url":"https:\/\/exceptionly.com\/","name":"Exceptionly","description":"Remote software talent acquisition at scale","publisher":{"@id":"https:\/\/exceptionly.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/exceptionly.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ar"},{"@type":"Organization","@id":"https:\/\/exceptionly.com\/#organization","name":"Exceptionly","url":"https:\/\/exceptionly.com\/","logo":{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/exceptionly.com\/#\/schema\/logo\/image\/","url":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/05\/exceptionly-search-logo.png","contentUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/05\/exceptionly-search-logo.png","width":400,"height":400,"caption":"Exceptionly"},"image":{"@id":"https:\/\/exceptionly.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/exceptionly\/","https:\/\/x.com\/exceptionly","https:\/\/www.linkedin.com\/company\/exceptionly\/","https:\/\/www.youtube.com\/channel\/UCet5wATTyif6knI0h4vUkNA"]},{"@type":"Person","@id":"https:\/\/exceptionly.com\/#\/schema\/person\/a2600170dfb4513350affede916c0ccf","name":"Fatma Elverir","image":{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/secure.gravatar.com\/avatar\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g","caption":"Fatma Elverir"},"sameAs":["https:\/\/exceptionly.com"],"url":"https:\/\/exceptionly.com\/ar\/author\/fatmaelverir\/"}]}},"_links":{"self":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/posts\/11277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/comments?post=11277"}],"version-history":[{"count":0,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/posts\/11277\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/media\/11493"}],"wp:attachment":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/media?parent=11277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/categories?post=11277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/tags?post=11277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}