{"id":94992,"date":"2019-08-23T10:00:58","date_gmt":"2019-08-23T07:00:58","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=94992"},"modified":"2019-08-20T15:38:11","modified_gmt":"2019-08-20T12:38:11","slug":"dockerizing-spring-boot-application-2","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html","title":{"rendered":"Dockerizing a Spring Boot Application"},"content":{"rendered":"<p>Hello Friends,<\/p>\n<p>In this tutorial,we will see how we can dockerize our Spring Boot Application.By dockerizing ,we mean that we are going to run our application as docker container.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"320\" height=\"273\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/Docker_Image.png\" alt=\"\" class=\"wp-image-95035\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/Docker_Image.png 320w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/Docker_Image-300x256.png 300w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/figure>\n<\/div>\n<p>Following are the steps involved :<\/p>\n<p>1. Create a Spring Boot Application<\/p>\n<p>2. Install Docker on your machine<\/p>\n<p>3. Create a Docker file in your project<\/p>\n<p>4. Docker build using docker file<\/p>\n<p>5. Docker run<\/p>\n<p>Let us see these steps one by one.<\/p>\n<h3 class=\"wp-block-heading\"><b>Step 1. Create a Spring Boot Application<\/b><\/h3>\n<p>Please follow my tutorial\u00a0 <a href=\"https:\/\/www.javacodegeeks.com\/2018\/02\/create-spring-boot-project-spring-initializer.html\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">How to Create Spring Boot Project With Spring Initializer<\/a>\u00a0for steps needed to create a Spring Boot project using Spring Boot Initiailizer.<\/p>\n<p>So once you complete this,you should be ready with springBootApp project in your workspace.<\/p>\n<h3 class=\"wp-block-heading\"><b>Step 2. Install Docker on your machine(Example here is for Windows10)<\/b><\/h3>\n<h2 class=\"wp-block-heading\"><b>&nbsp;2.1 <\/b>Go to&nbsp;<a href=\"https:\/\/hub.docker.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Docker Hub<\/a>&nbsp;<\/h2>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"640\" height=\"327\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/DockerHubHome.jpg\" alt=\"\" class=\"wp-image-95036\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/DockerHubHome.jpg 640w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/DockerHubHome-300x153.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/figure>\n<\/div>\n<p><b>2.2<\/b> Sign in to the Docker Hub.If you don&#8217;t have account,create a new account by clicking on Create Account.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"640\" height=\"319\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/SignIntoDocker.jpg\" alt=\"\" class=\"wp-image-95037\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/SignIntoDocker.jpg 640w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/SignIntoDocker-300x150.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/figure>\n<\/div>\n<p>&nbsp;<br \/><b>2.3 <\/b>Click on Download Docker Desktop on the below screen<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"640\" height=\"318\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/DownloadDockerDesktop.jpg\" alt=\"\" class=\"wp-image-95038\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/DownloadDockerDesktop.jpg 640w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/DownloadDockerDesktop-300x149.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/figure>\n<\/div>\n<p><b>2.4<\/b> Click on the &#8220;Download Docker Desktop for Windows&#8221; to download Installer for Windows.<\/p>\n<p>&nbsp; &nbsp; &nbsp;For downloading installer for Mac,click on &#8220;Docker Desktop for Mac&#8221;.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"640\" height=\"329\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/DownloadDockerDesktop_Page2.jpg\" alt=\"\" class=\"wp-image-95039\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/DownloadDockerDesktop_Page2.jpg 640w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/DownloadDockerDesktop_Page2-300x154.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/figure>\n<\/div>\n<p><b>2.5 <\/b>Follow the steps mentioned\u00a0 <a rel=\"noopener noreferrer\" href=\"https:\/\/docs.docker.com\/docker-for-windows\/install\/\" target=\"_blank\"><b>here<\/b><\/a>\u00a0to install Docker from Installer and your Docker should be up and running.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>From\u00a0 <a rel=\"noopener noreferrer\" href=\"https:\/\/docs.docker.com\/docker-for-windows\/install\/\" target=\"_blank\">Docker Docs<\/a><\/p>\n<p>&#8211; What the Docker Desktop for Windows install includes: The installation provides <a href=\"https:\/\/docs.docker.com\/engine\/userguide\/\">Docker Engine<\/a>, Docker CLI client,<a href=\"https:\/\/docs.docker.com\/compose\/overview\/\">Docker Compose<\/a>,<a href=\"https:\/\/docs.docker.com\/machine\/overview\/\">Docker Machine<\/a><br \/>, and <a href=\"https:\/\/docs.docker.com\/kitematic\/userguide\/\">Kitematic<\/a>.<\/p>\n<p>&#8211; Containers and images created with Docker Desktop for Windows are shared between all user accounts on machines where it is installed. This is because all Windows accounts use the same VM to build and run containers.<\/p>\n<p>&#8211; Nested virtualization scenarios, such as running Docker Desktop for Windows on a VMWare or Parallels instance might work, but there are no guarantees.<\/p>\n<h3 class=\"wp-block-heading\"><b>3. Create a Docker file in your project<\/b><\/h3>\n<p>Before we create a docker file,let us understand what is docker file and why it is required.<\/p>\n<h2 class=\"wp-block-heading\"><b>3.1<\/b> <b>What is Docker File ?<\/b><\/h2>\n<p>Docker file is text file which has set of instructions or commands which will be executed by&nbsp; &nbsp; &nbsp; Docker demon to create a docker image.<\/p>\n<p>Example of Docker file :<\/p>\n<p>FROM\u00a0 openjdk:8 u212-b04-jdk- stretch<br \/>COPY target\/springBootApp-0.0.1-SNAPSHOT.jar springBootApp-0.0.1-SNAPSHOT.jar<br \/>EXPOSE 8080<br \/>ENTRYPOINT [&#8220;java&#8221;, &#8220;-jar&#8221;, &#8220;springBootApp-0.0.1-SNAPSHOT.jar&#8221;]<\/p>\n<p><b>3.2 Why Docker File is required<\/b><\/p>\n<p>By executing the docker file basically we are creating a docker image.This image has all the details required to run the application viz. application code,system libraries,tools.Now we can run this image on any machine which has docker installed and it will get same execution environment.Say I have multiple environments to which my application code will go through before moving to production like ST,ET.Now if I execute this docker image on any of these(ST,ET,Prod) machine,it will make sure that application has same execution environment.<\/p>\n<p>Also it is worth mentioning that once we run our docker image ,it becomes container and we can see container by executing following command:<\/p>\n<p><b>docker container ls<\/b><\/p>\n<h3 class=\"wp-block-heading\"><b>4. Docker build using docker file<\/b><\/h3>\n<p>To execute commands or instructions in docker file,we need to execute docker build command on the command prompt as below :<\/p>\n<p><b>docker build -t &lt;tag name&gt; .<\/b><\/p>\n<p>docker build command builds the docker images from a dockerfile and&nbsp; a &#8220;context&#8221;.A build&#8217;s context is a set of files&nbsp; located in the specified PATH or URL.The build process can refer to any of the file in the context.For example,our build can use a COPY instruction to reference a file in the context.<\/p>\n<h2 class=\"wp-block-heading\"><b>4.1 PATH<\/b><\/h2>\n<p>In the below example,PATH is current directory(dot),so the context will be built by using files and folders in the project folder(from&nbsp; where we are executing this command)<\/p>\n<p><b>docker build -t &lt;tag name&gt; .<\/b><\/p>\n<p>In the below example,<\/p>\n<p><b>docker build -t &#8220;springbootapp&#8221; .<\/b><\/p>\n<p>docker build command needs to be executed from the root of your project where you have placed your docker file and name of the file has to be dockerfile(case insensitive).When we execute docker build,all the instructions in the docker file are executed one by one and a docker Image is created with name given in &#8220;tag name&#8221;.<\/p>\n<p>We can check the newly created docker image by executing following command:<\/p>\n<p><b>docker image l<\/b>s<\/p>\n<h2 class=\"wp-block-heading\"><b>4.2 URL<\/b><\/h2>\n<p>With the URL parameter,we can mention the url of the Github or bitbucket repository.Docker build will then recursively pull the directories ,subdirectories,files from that repository and will use it as build context and send it to the Docker daemon.<\/p>\n<p><b>docker build -t &lt;tag name&gt;&nbsp; &lt;Repository Url&gt;<\/b><\/p>\n<p><b><br \/><\/b> In this case,docker will clone the remote repository and will use cloned repository as build context.<\/p>\n<h3 class=\"wp-block-heading\"><b>5. Docker run<\/b><\/h3>\n<p>Docker run command runs the docker image. Runtime instance of docker image is called docker container.<\/p>\n<p><b>docker run -p 8080:8080 &lt;image name><\/b><br \/><b><br \/><\/b>By default container does not publish any port.Here we are mapping port 8080 of the container to the port 8080 of the host machine.<\/p>\n<p>So basically,after docker run,your application will be up and running as container.<\/p>\n<h3 class=\"wp-block-heading\"><b>Summary<\/b><\/h3>\n<p>By dockerizing our Java application,we make sure that our application gets same kind of execution environment&nbsp;across DEV,ST,ET,PR to make sure that application behaviour&nbsp;does not change due to change in application environment(DEV,ST etc.).<\/p>\n<h3 class=\"wp-block-heading\">References :<\/h3>\n<p><a href=\"https:\/\/docs.docker.com\/\">https:\/\/docs.docker.com\/<\/a><\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>Published on Java Code Geeks with permission by Gaurav Bhardwaj, partner at our <a href=\"\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener noreferrer\">JCG program<\/a>. See the original article here: <a href=\"http:\/\/javasolutionsguide.blogspot.com\/2019\/08\/dockerizing-spring-boot-application.html\" target=\"_blank\" rel=\"noopener noreferrer\">Dockerizing a Spring Boot Application<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hello Friends, In this tutorial,we will see how we can dockerize our Spring Boot Application.By dockerizing ,we mean that we are going to run our application as docker container. Following are the steps involved : 1. Create a Spring Boot Application 2. Install Docker on your machine 3. Create a Docker file in your project &hellip;<\/p>\n","protected":false},"author":955,"featured_media":24013,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[936,854],"class_list":["post-94992","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-docker","tag-spring-boot"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Dockerizing a Spring Boot Application - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn about Spring Boot Application? Check our article explaining how we can dockerize our Spring Boot Application.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dockerizing a Spring Boot Application - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn about Spring Boot Application? Check our article explaining how we can dockerize our Spring Boot Application.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-23T07:00:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/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=\"Gaurav Bhardwaj\" \/>\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=\"Gaurav Bhardwaj\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html\"},\"author\":{\"name\":\"Gaurav Bhardwaj\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/58bd3e1f6edc1bed6a6374fe9a34ca37\"},\"headline\":\"Dockerizing a Spring Boot Application\",\"datePublished\":\"2019-08-23T07:00:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html\"},\"wordCount\":938,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/04\\\/docker-logo.jpg\",\"keywords\":[\"Docker\",\"Spring Boot\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html\",\"name\":\"Dockerizing a Spring Boot Application - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/04\\\/docker-logo.jpg\",\"datePublished\":\"2019-08-23T07:00:58+00:00\",\"description\":\"Interested to learn about Spring Boot Application? Check our article explaining how we can dockerize our Spring Boot Application.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/04\\\/docker-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/04\\\/docker-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/08\\\/dockerizing-spring-boot-application-2.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Dockerizing a Spring Boot Application\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/58bd3e1f6edc1bed6a6374fe9a34ca37\",\"name\":\"Gaurav Bhardwaj\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/657921afcac1f1ddf98dfb349121a07b4dcc1d42d5bd277150cf3ed8156de723?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/657921afcac1f1ddf98dfb349121a07b4dcc1d42d5bd277150cf3ed8156de723?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/657921afcac1f1ddf98dfb349121a07b4dcc1d42d5bd277150cf3ed8156de723?s=96&d=mm&r=g\",\"caption\":\"Gaurav Bhardwaj\"},\"description\":\"Gaurav has done Masters in Computer Applications(MCA) and is working in Software development field for more than 10 years in Java\\\/J2EE technologies. He is currently working with one of top MNC. He has worked on various frameworks like Struts, Spring, Spring Boot, Angular JS, JSF, Velocity, iBatis, MyBatis, Hibernate, JUnit, Mockito, Dozzer. He likes to explore new technologies and share his thoughts by writing a technical blog. He is the founder of JavaSolutionsGuide.blogspot.com.\",\"sameAs\":[\"http:\\\/\\\/www.javasolutionsguide.blogspot.nl\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/gaurav-bhardwaj\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Dockerizing a Spring Boot Application - Java Code Geeks","description":"Interested to learn about Spring Boot Application? Check our article explaining how we can dockerize our Spring Boot Application.","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:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html","og_locale":"en_US","og_type":"article","og_title":"Dockerizing a Spring Boot Application - Java Code Geeks","og_description":"Interested to learn about Spring Boot Application? Check our article explaining how we can dockerize our Spring Boot Application.","og_url":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2019-08-23T07:00:58+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/docker-logo.jpg","type":"image\/jpeg"}],"author":"Gaurav Bhardwaj","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Gaurav Bhardwaj","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html"},"author":{"name":"Gaurav Bhardwaj","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/58bd3e1f6edc1bed6a6374fe9a34ca37"},"headline":"Dockerizing a Spring Boot Application","datePublished":"2019-08-23T07:00:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html"},"wordCount":938,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/docker-logo.jpg","keywords":["Docker","Spring Boot"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html","url":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html","name":"Dockerizing a Spring Boot Application - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/docker-logo.jpg","datePublished":"2019-08-23T07:00:58+00:00","description":"Interested to learn about Spring Boot Application? Check our article explaining how we can dockerize our Spring Boot Application.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/docker-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/docker-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2019\/08\/dockerizing-spring-boot-application-2.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Dockerizing a Spring Boot Application"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/58bd3e1f6edc1bed6a6374fe9a34ca37","name":"Gaurav Bhardwaj","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/657921afcac1f1ddf98dfb349121a07b4dcc1d42d5bd277150cf3ed8156de723?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/657921afcac1f1ddf98dfb349121a07b4dcc1d42d5bd277150cf3ed8156de723?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/657921afcac1f1ddf98dfb349121a07b4dcc1d42d5bd277150cf3ed8156de723?s=96&d=mm&r=g","caption":"Gaurav Bhardwaj"},"description":"Gaurav has done Masters in Computer Applications(MCA) and is working in Software development field for more than 10 years in Java\/J2EE technologies. He is currently working with one of top MNC. He has worked on various frameworks like Struts, Spring, Spring Boot, Angular JS, JSF, Velocity, iBatis, MyBatis, Hibernate, JUnit, Mockito, Dozzer. He likes to explore new technologies and share his thoughts by writing a technical blog. He is the founder of JavaSolutionsGuide.blogspot.com.","sameAs":["http:\/\/www.javasolutionsguide.blogspot.nl\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/gaurav-bhardwaj"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/94992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/955"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=94992"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/94992\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/24013"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=94992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=94992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=94992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}