{"id":86660,"date":"2020-03-20T11:00:19","date_gmt":"2020-03-20T09:00:19","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=86660"},"modified":"2020-03-17T12:21:24","modified_gmt":"2020-03-17T10:21:24","slug":"deploying-a-simple-spring-boot-application-on-docker","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/","title":{"rendered":"Deploying a simple Spring Boot application on Docker"},"content":{"rendered":"<p>Welcome readers, in this tutorial, we will discuss how to <em>deploy a simple Spring Boot application on Docker<\/em>.<\/p>\n<h2>1. Introduction to Docker<\/h2>\n<p>In the present world, <strong>Docker<\/strong> is an important term,<\/p>\n<ul>\n<li>Often used in CI\/CD platform that packages and runs the application with its dependencies inside a container<\/li>\n<li>Is a standard for Linux Containers<\/li>\n<li>A <em>Container<\/em> is a runtime that runs under any Linux kernel and provides a private machine-like space under Linux<\/li>\n<\/ul>\n<h3>1.1 Docker Terminology<\/h3>\n<ul>\n<li><strong>Image<\/strong>: Representation of Docker container i.e. a JAR or WAR file in Java<\/li>\n<li><strong>Container<\/strong>: Runtime of Docker i.e. a deployed and running Docker image. For example, an executable Spring Boot jar<\/li>\n<li><strong>Engine<\/strong>: The code that manages, creates and runs the Docker containers<\/li>\n<li><strong>Hub<\/strong>: A public developers registry to distribute their code<\/li>\n<li><strong>Repository<\/strong>: A collection of Docker related images i.e. different versions of the same application<\/li>\n<\/ul>\n<h3>1.2 Docker Command Basics<\/h3>\n<p>Here\u2019s an example command.<\/p>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"817\" height=\"286\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/Docker-command-syntax-img1-1.jpg\" alt=\"Deploy Spring Boot on Docker - Basic structure\" class=\"wp-image-86661\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/Docker-command-syntax-img1-1.jpg 817w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/Docker-command-syntax-img1-1-300x105.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/Docker-command-syntax-img1-1-768x269.jpg 768w\" sizes=\"(max-width: 817px) 100vw, 817px\" \/><figcaption>Fig. 1: Basic structure<\/figcaption><\/figure>\n<h3>1.3 Need for using Docker<\/h3>\n<ul>\n<li>For environment replication, while the code runs locally on the machine<\/li>\n<li>For numerous deployment phases i.e. Dev\/Test\/QA<\/li>\n<li>For version control and distributing the application\u2019s OS within a team<\/li>\n<\/ul>\n<h3>1.4 Setting up Docker<\/h3>\n<p>If someone needs to go through the Docker installation, please watch <a href=\"https:\/\/www.youtube.com\/watch?v=R-ZMkGvh-9Y\" target=\"_blank\" rel=\"noopener noreferrer\">this<\/a> video.<\/p>\n<p>To start with this tutorial, we are hoping that users at present know how to create a simple hello-world spring-boot application.<\/p>\n<h2>2. Deploying a simple Spring Boot application on Docker<\/h2>\n<h3>2.1 Application pre-requisite<\/h3>\n<p>To deploy a Spring Boot application on Docker, developers need to ensure that they add\/have the following plugin to the application\u2019s <code>pom.xml<\/code> file.<\/p>\n<div>\n<div id=\"highlighter_436470\" class=\"syntaxhighlighter  xml\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<div class=\"line number2 index1 alt1\">2<\/div>\n<div class=\"line number3 index2 alt2\">3<\/div>\n<div class=\"line number4 index3 alt1\">4<\/div>\n<div class=\"line number5 index4 alt2\">5<\/div>\n<div class=\"line number6 index5 alt1\">6<\/div>\n<div class=\"line number7 index6 alt2\">7<\/div>\n<div class=\"line number8 index7 alt1\">8<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"xml comments\">&lt;!-- To make spring boot as a fat jar so that all required jar files and <\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml comments\">main file is added for running the code from Docker. --&gt;<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">plugins<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">plugin<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">groupId<\/code><code class=\"xml plain\">&gt;org.springframework.boot&lt;\/<\/code><code class=\"xml keyword\">groupId<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">artifactId<\/code><code class=\"xml plain\">&gt;spring-boot-maven-plugin&lt;\/<\/code><code class=\"xml keyword\">artifactId<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;\/<\/code><code class=\"xml keyword\">plugin<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"xml plain\">&lt;\/<\/code><code class=\"xml keyword\">plugins<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>2.2 Preparing the Dockerfile<\/h3>\n<p>To deploy a Spring Boot application on Docker, it is important to create an image file for our application. To create an image file, we\u2019ll add the <code>Dockerfile<\/code> in the project\u2019s root directory as shown in the project structure and add the following code to it.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div>[ulp id=&#8217;6PVIvOz3kDbYmNRn&#8217;]<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"297\" height=\"272\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/springboot-on-docker-project-structure-img1.jpg\" alt=\"Deploy Spring Boot on Docker - Project structure \" class=\"wp-image-86662\"\/><figcaption>Fig. 2: Project structure<\/figcaption><\/figure>\n<\/div>\n<pre class=\"brush:plain; wrap-lines:false;\"># Pull the centos image from DockerHub repository to build our application as a base\n# The centos image will act as a base image\nFROM centos\n\n# Installing java to our image\nRUN yum install -y java\n\n# Creating a temporary directory\nVOLUME \/tmp\n\n# Steps to run the spring boot application\n# Copy the application\u2019s jar from target directory and name it\nADD .\/target\/SpringbootOnDocker.jar myapp.jar\nRUN sh -c 'touch \/myapp.jar'\nENTRYPOINT [\"java\",\"-Djava.security.egd=file:\/dev\/.\/urandom\",\"-jar\",\"\/myapp.jar\"]\n<\/pre>\n<h3>2.3 Build the image<\/h3>\n<p>Open the terminal and navigate to the project directory and execute the below commands to build the application and the image.<\/p>\n<pre class=\"brush:plain; wrap-lines:false;\"># To prepare the jar package for the application\n&gt; mvn clean install\n\n# To prepare the image with a name\n&gt; docker build -t jcgassignment .\n<\/pre>\n<p>If everything goes well, the image will be created. We can use the <code>docker images<\/code> command to list the newly created image as shown in Fig. 3.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"778\" height=\"152\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/springboot-on-docker-image-creation-img1.jpg\" alt=\"Deploy Spring Boot on Docker - newly created Docker image\" class=\"wp-image-86663\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/springboot-on-docker-image-creation-img1.jpg 778w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/springboot-on-docker-image-creation-img1-300x59.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/springboot-on-docker-image-creation-img1-768x150.jpg 768w\" sizes=\"(max-width: 778px) 100vw, 778px\" \/><figcaption>Fig. 3: Viewing the newly created Docker image<\/figcaption><\/figure>\n<\/div>\n<h3>2.4 Starting the Docker container<\/h3>\n<p>Now we can run the below command to start the container and can hit the application url (<code>http:\/\/localhost:9099\/<\/code>) as shown in Fig. 4.<\/p>\n<pre class=\"brush:plain; wrap-lines:false;\">docker run -d -p 9099:9099 jcgassignment<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"818\" height=\"140\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/springboot-on-docker-demo-img1.jpg\" alt=\"\" class=\"wp-image-86664\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/springboot-on-docker-demo-img1.jpg 818w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/springboot-on-docker-demo-img1-300x51.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/springboot-on-docker-demo-img1-768x131.jpg 768w\" sizes=\"(max-width: 818px) 100vw, 818px\" \/><figcaption>Fig. 4: Application\u2019s index page<\/figcaption><\/figure>\n<\/div>\n<p>Try out these commands in your development environment to practice and learn.<\/p>\n<h2>3. Conclusion<\/h2>\n<p>That is all for this tutorial and I hope the tutorial will help you understand the basic commands to deploy a Spring Boot application on Docker. Happy learning and do not forget to share!<\/p>\n<h2>4. Download the source code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>You can download the full source code of this example here: <a target=\"_blank\" href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/03\/SpringbootOnDocker.zip\" rel=\"noopener noreferrer\"><strong>Deploying a simple Spring Boot application on Docker<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Welcome readers, in this tutorial, we will discuss how to deploy a simple Spring Boot application on Docker. 1. Introduction to Docker In the present world, Docker is an important term, Often used in CI\/CD platform that packages and runs the application with its dependencies inside a container Is a standard for Linux Containers A &hellip;<\/p>\n","protected":false},"author":119,"featured_media":31013,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1354],"tags":[1318,1276,1386],"class_list":["post-86660","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","tag-devops","tag-docker","tag-spring-boot"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Deploying a simple Spring Boot application on Docker - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Welcome readers, in this tutorial, we will discuss how to deploy a simple Spring Boot application on Docker. 1. Introduction to Docker In the present\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deploying a simple Spring Boot application on Docker - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Welcome readers, in this tutorial, we will discuss how to deploy a simple Spring Boot application on Docker. 1. Introduction to Docker In the present\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-20T09:00:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yatin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yatin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/\"},\"author\":{\"name\":\"Yatin\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\"},\"headline\":\"Deploying a simple Spring Boot application on Docker\",\"datePublished\":\"2020-03-20T09:00:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/\"},\"wordCount\":482,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg\",\"keywords\":[\"devops\",\"docker\",\"spring boot\"],\"articleSection\":[\"Docker\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/\",\"name\":\"Deploying a simple Spring Boot application on Docker - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg\",\"datePublished\":\"2020-03-20T09:00:19+00:00\",\"description\":\"Welcome readers, in this tutorial, we will discuss how to deploy a simple Spring Boot application on Docker. 1. Introduction to Docker In the present\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DevOps\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/devops\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Docker\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/devops\/docker\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Deploying a simple Spring Boot application on Docker\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\",\"name\":\"Yatin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"caption\":\"Yatin\"},\"description\":\"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Deploying a simple Spring Boot application on Docker - Java Code Geeks","description":"Welcome readers, in this tutorial, we will discuss how to deploy a simple Spring Boot application on Docker. 1. Introduction to Docker In the present","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:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/","og_locale":"en_US","og_type":"article","og_title":"Deploying a simple Spring Boot application on Docker - Java Code Geeks","og_description":"Welcome readers, in this tutorial, we will discuss how to deploy a simple Spring Boot application on Docker. 1. Introduction to Docker In the present","og_url":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2020-03-20T09:00:19+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg","type":"image\/jpeg"}],"author":"Yatin","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yatin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/"},"author":{"name":"Yatin","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13"},"headline":"Deploying a simple Spring Boot application on Docker","datePublished":"2020-03-20T09:00:19+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/"},"wordCount":482,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg","keywords":["devops","docker","spring boot"],"articleSection":["Docker"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/","url":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/","name":"Deploying a simple Spring Boot application on Docker - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg","datePublished":"2020-03-20T09:00:19+00:00","description":"Welcome readers, in this tutorial, we will discuss how to deploy a simple Spring Boot application on Docker. 1. Introduction to Docker In the present","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/deploying-a-single-spring-boot-application-on-docker\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"DevOps","item":"https:\/\/examples.javacodegeeks.com\/category\/devops\/"},{"@type":"ListItem","position":3,"name":"Docker","item":"https:\/\/examples.javacodegeeks.com\/category\/devops\/docker\/"},{"@type":"ListItem","position":4,"name":"Deploying a simple Spring Boot application on Docker"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13","name":"Yatin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","caption":"Yatin"},"description":"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/86660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=86660"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/86660\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/31013"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=86660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=86660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=86660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}