{"id":29874,"date":"2015-12-21T11:00:46","date_gmt":"2015-12-21T09:00:46","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=29874"},"modified":"2019-03-29T14:18:00","modified_gmt":"2019-03-29T12:18:00","slug":"introduction-docker-java-developers","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/","title":{"rendered":"Introduction to Docker for Java Developers &#8211; Getting started with Docker"},"content":{"rendered":"<h2>1. Introduction<\/h2>\n<p>According the official definition of Docker, it is an open platform for building, shipping and running distributed applications. It gives programmers, development teams and operations engineers the common toolbox they need to take advantage of the distributed and networked nature of modern applications. In other&nbsp;words,&nbsp;Docker is a tool to avoid the&nbsp;usual headaches of conflicts, dependencies and inconsistent environments, which is an important problem for&nbsp;distributed applications, where we need to install or upgrade several nodes with&nbsp;the same configuration.<\/p>\n<p>Docker is a container manager, which means that is able to create and execute containers that represent specific runtime environments for&nbsp;your software. In contrast with virtual machines like VirualBox, Docker uses resource isolation features of the Linux kernel&nbsp;to allow independent &#8220;containers&#8221; to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines.&nbsp;A&nbsp;computer with docker can run multiple containers at the same time.<\/p>\n<p>Docker has a public repository of runtime environments(i.e. Docker images), which is called <a href=\"https:\/\/hub.docker.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Docker Hub<\/a>. In this repository allows Docker download and start an specific runtime environments for an specific software (e.g. MongoDB or MySQL) without any installation procedure.\n<\/p>\n<h2>2. Docker Setup<\/h2>\n<p>The installation instructions for Docker depends on your operative system and are widely explained (<a href=\"http:\/\/docs.docker.com\/installation\/mac\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> for mac, <a href=\"http:\/\/docs.docker.com\/installation\/windows\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> for windows and <a href=\"http:\/\/docs.docker.com\/installation\/ubuntulinux\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> for ubuntu). Once, you have&nbsp;followed the installation instructions,&nbsp;you should be able to run the following command.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Docker installation test<\/em><\/span><\/p>\n<pre class=\"brush:bash\">$ docker run ubuntu:14.04 \/bin\/echo 'It works!'\nIt works!\n<\/pre>\n<h2>3. Java Hello World for Docker<\/h2>\n<p>In this example, we are going to run the typical Java Hello World example in&nbsp;docker. We shall use <em>Maven<\/em> to setup a new project for Hello&nbsp;word example. The contents of our maven project descriptor should be as follows:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>pom.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\nxsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\n  &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\n  &lt;groupId&gt;com.javacodegeeks&lt;\/groupId&gt;\n  &lt;artifactId&gt;helloworld&lt;\/artifactId&gt;\n  &lt;version&gt;1.0&lt;\/version&gt;\n  &lt;\/project&gt;\n<\/pre>\n<p>Now, add&nbsp;a Java class into the source folder (<b>src\/main\/java<\/b> directory) with the following code.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><span style=\"text-decoration: underline;\"><em>HelloWorld.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">public class HelloWorld { \n  public static void main(String[] args) throws Exception{ \n    System.out.println(\"Hello World\"); \n  } \n}\n<\/pre>\n<p>After that,&nbsp;create a file called <em>Dockerfile<\/em> into the root directory of the project and copy the following contents.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Dockerfile<\/em><\/span><\/p>\n<pre class=\"brush:bash\">FROM ubuntu:14.04\nMAINTAINER javacodegeeks\n\nRUN apt-get update &amp;&amp; apt-get install -y python-software-properties software-properties-common\nRUN add-apt-repository ppa:webupd8team\/java\n\nRUN echo \"oracle-java8-installer shared\/accepted-oracle-license-v1-1 boolean true\" | debconf-set-selections\n\nRUN apt-get update &amp;&amp; apt-get install -y oracle-java8-installer maven\n\nADD . \/usr\/local\/helloworld\nRUN cd \/usr\/local\/helloworld &amp;&amp; mvn install\nCMD [\"java\", \"-cp\", \"\/usr\/local\/helloworld\/target\/helloworld-1.0.jar\", \"HelloWorld\"]\n<\/pre>\n<p>This file contains the set of commands that docker executes to create an execution environment for our application. An execution environment is called <em>Docker image<\/em>. The last line, which starts with <code>CMD<\/code>, is the command that launches our application. A single machine can have different simultaneous executions of the same docker image. Each of these executions is called <em>Docker container<\/em>.<\/p>\n<p>Now, let&#8217;s understand the Dockerfile commands of our example:<\/p>\n<hr>\n<ul>\n<li><code>FROM<\/code>: Specifies the original required software that our <em>Dockerfile<\/em> requires to start. In this case, we have selected Ubuntu, version 14.04.<\/li>\n<li><code>MANTAINER<\/code>: The author of the <em>Dockerfile<\/em>.<\/li>\n<li><code>RUN<\/code>: Run a unix command in order to build the container.<\/li>\n<li><code>ADD<\/code>: Adds local files inside the container.<\/li>\n<li><code>CMD<\/code>: It is the command that is executed once the container starts. After the command ends, the container stops.<\/li>\n<\/ul>\n<p>A <em>Dockerfile<\/em> can be located in any directory of our machine, but if it is stored inside our project, it is cleaner to move the contents of your project into a Docker image with the <code>ADD<\/code> instruction. Indeed, if the project repository belongs to GitHub or Bitbucket, the Docker Hub service allows to store a hook(i.e listener) to automatically rebuild the Docker image when a new push arrives. This approach allows to ensure <em>continous delivery<\/em> for your docker images. The following image shows the described Docker Hub workflow.[ulp id=&#8217;6PVIvOz3kDbYmNRn&#8217;]<\/p>\n<p><figure id=\"attachment_30745\" aria-describedby=\"caption-attachment-30745\" style=\"width: 428px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/dockerhub1.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/dockerhub1.jpg\" alt=\"Docker Hub Workflow\" width=\"428\" height=\"375\" class=\"size-full wp-image-30745\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/dockerhub1.jpg 428w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/dockerhub1-300x263.jpg 300w\" sizes=\"(max-width: 428px) 100vw, 428px\" \/><\/a><figcaption id=\"caption-attachment-30745\" class=\"wp-caption-text\">Docker Hub Workflow<\/figcaption><\/figure><\/p>\n<h2>4. Running the example<\/h2>\n<p>Now, we are going to&nbsp;build the Docker image. Open a prompt and go to the directory where the Dockerfile is located. Now, you just need to execute the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Docker build command<\/em><\/span><\/p>\n<pre class=\"brush:bash\">docker build -t javacodegeeks\/helloworld:1.0 .<\/pre>\n<p>Once the command ends, the last line should be similar to this one:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Docker build output<\/em><\/span><\/p>\n<pre class=\"brush:bash\">Successfully built 29336bbbfa5c\n<\/pre>\n<p>At this moment, Docker has created an image called <b>javacodegeeks\/helloworld:1.0<\/b>. Now, let&#8217;s create and start a container for this image with the <code>docker run<\/code> command.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Docker run command<\/em><\/span><\/p>\n<pre class=\"brush:bash\">docker run --name helloworldcontainer javacodegeeks\/helloworld:1.0\nHelloWorld\n<\/pre>\n<p>Now, a new container called <em>helloworldcontainer<\/em> has been <em>created<\/em> and <em>executed<\/em> in our machine. Each docker container must have a unique name. Therefore, the same command just can be executed again if the container name is different or the existing container is removed. Let&#8217;s see what are the current containers in our machine with the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Docker ps command<\/em><\/span><\/p>\n<pre class=\"brush:bash\">docker ps -a\n<\/pre>\n<p>It shows a table like this one:<\/p>\n<p><figure id=\"attachment_30439\" aria-describedby=\"caption-attachment-30439\" style=\"width: 860px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/outputdocker.jpg\"><img decoding=\"async\" class=\"size-full wp-image-30439\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/outputdocker.jpg\" alt=\"docker ps output\" width=\"860\" height=\"161\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/outputdocker.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/outputdocker-300x56.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-30439\" class=\"wp-caption-text\">docker ps output<\/figcaption><\/figure><\/p>\n<p>The status of our container is <em>Excited<\/em> successfully because the exit code is <em>0<\/em>. In order to execute it again, it is necessary to restart the container with the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Docker start command<\/em><\/span><\/p>\n<pre class=\"brush:bash\">docker start helloworldcontainer\n<\/pre>\n<p>By default, the command <code>docker start<\/code> does not print the container standard output. However, we can see it using the command <code>docker log<\/code> as follows:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Docker logs command<\/em><\/span><\/p>\n<pre class=\"brush:bash\">docker logs helloworldcontainer<\/pre>\n<p>Usually, Docker images and containers need a considerable disk space. In order to clean our environment, we need to perform the following actions:<\/p>\n<ul>\n<li>Remove the container:<span style=\"text-decoration: underline;\"><em>Docker remove container command<\/em><\/span>\n<pre class=\"brush:bash\">docker rm helloworldcontainer<\/pre>\n<\/li>\n<li>Remove the image:<span style=\"text-decoration: underline;\"><em>Docker remove image command<\/em><\/span>\n<pre class=\"brush:bash\">docker rmi javacodegeeks\/helloworld:1.0<\/pre>\n<\/li>\n<\/ul>\n<h2>5. Download the complete source code<\/h2>\n<p>This was an example of how running a Java program in Docker.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-example4j.zip\"><b>docker-example4j<\/b><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction According the official definition of Docker, it is an open platform for building, shipping and running distributed applications. It gives programmers, development teams and operations engineers the common toolbox they need to take advantage of the distributed and networked nature of modern applications. In other&nbsp;words,&nbsp;Docker is a tool to avoid the&nbsp;usual headaches of &hellip;<\/p>\n","protected":false},"author":79,"featured_media":31013,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1354],"tags":[1276,1254],"class_list":["post-29874","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","tag-docker","tag-helloworld"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Introduction to Docker for Java Developers - Getting started with Docker - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"1. Introduction According the official definition of Docker, it is an open platform for building, shipping and running distributed applications. It gives\" \/>\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\/devops\/docker\/introduction-docker-java-developers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introduction to Docker for Java Developers - Getting started with Docker - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"1. Introduction According the official definition of Docker, it is an open platform for building, shipping and running distributed applications. It gives\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/\" \/>\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=\"2015-12-21T09:00:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-29T12:18:00+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=\"Raquel Pau\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@raquelpau\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Raquel Pau\" \/>\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:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/\"},\"author\":{\"name\":\"Raquel Pau\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/24fb3af8dc3ca7c96640954e2a42ad5c\"},\"headline\":\"Introduction to Docker for Java Developers &#8211; Getting started with Docker\",\"datePublished\":\"2015-12-21T09:00:46+00:00\",\"dateModified\":\"2019-03-29T12:18:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/\"},\"wordCount\":868,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg\",\"keywords\":[\"docker\",\"HelloWorld\"],\"articleSection\":[\"Docker\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/\",\"name\":\"Introduction to Docker for Java Developers - Getting started with Docker - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg\",\"datePublished\":\"2015-12-21T09:00:46+00:00\",\"dateModified\":\"2019-03-29T12:18:00+00:00\",\"description\":\"1. Introduction According the official definition of Docker, it is an open platform for building, shipping and running distributed applications. It gives\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#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\/devops\/docker\/introduction-docker-java-developers\/#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\":\"Introduction to Docker for Java Developers &#8211; Getting started with 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\/24fb3af8dc3ca7c96640954e2a42ad5c\",\"name\":\"Raquel Pau\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Raquel-Fernandez-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Raquel-Fernandez-96x96.jpg\",\"caption\":\"Raquel Pau\"},\"description\":\"Raquel has graduated from Computer Engineering in the Universitat Politecnica de Catalunya. She also holds a Master degree in Computation (Software Engineering) from the same university. She has an I+D profile focused about model driven development. Additionally, she is the project leader of Walkmod, an open source project to code conventions, which is part of the result of her interest in the model driven development. Currently, Raquel works as a Software Architect in the Sparsity-Technologies.\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\/\",\"https:\/\/x.com\/raquelpau\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/raquel-fernandez\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Introduction to Docker for Java Developers - Getting started with Docker - Java Code Geeks","description":"1. Introduction According the official definition of Docker, it is an open platform for building, shipping and running distributed applications. It gives","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\/devops\/docker\/introduction-docker-java-developers\/","og_locale":"en_US","og_type":"article","og_title":"Introduction to Docker for Java Developers - Getting started with Docker - Java Code Geeks","og_description":"1. Introduction According the official definition of Docker, it is an open platform for building, shipping and running distributed applications. It gives","og_url":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2015-12-21T09:00:46+00:00","article_modified_time":"2019-03-29T12:18:00+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":"Raquel Pau","twitter_card":"summary_large_image","twitter_creator":"@raquelpau","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Raquel Pau","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/"},"author":{"name":"Raquel Pau","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/24fb3af8dc3ca7c96640954e2a42ad5c"},"headline":"Introduction to Docker for Java Developers &#8211; Getting started with Docker","datePublished":"2015-12-21T09:00:46+00:00","dateModified":"2019-03-29T12:18:00+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/"},"wordCount":868,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg","keywords":["docker","HelloWorld"],"articleSection":["Docker"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/","url":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/","name":"Introduction to Docker for Java Developers - Getting started with Docker - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/docker-logo.jpg","datePublished":"2015-12-21T09:00:46+00:00","dateModified":"2019-03-29T12:18:00+00:00","description":"1. Introduction According the official definition of Docker, it is an open platform for building, shipping and running distributed applications. It gives","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/devops\/docker\/introduction-docker-java-developers\/#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\/devops\/docker\/introduction-docker-java-developers\/#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":"Introduction to Docker for Java Developers &#8211; Getting started with 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\/24fb3af8dc3ca7c96640954e2a42ad5c","name":"Raquel Pau","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Raquel-Fernandez-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Raquel-Fernandez-96x96.jpg","caption":"Raquel Pau"},"description":"Raquel has graduated from Computer Engineering in the Universitat Politecnica de Catalunya. She also holds a Master degree in Computation (Software Engineering) from the same university. She has an I+D profile focused about model driven development. Additionally, she is the project leader of Walkmod, an open source project to code conventions, which is part of the result of her interest in the model driven development. Currently, Raquel works as a Software Architect in the Sparsity-Technologies.","sameAs":["http:\/\/www.javacodegeeks.com\/","https:\/\/x.com\/raquelpau"],"url":"https:\/\/examples.javacodegeeks.com\/author\/raquel-fernandez\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/29874","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\/79"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=29874"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/29874\/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=29874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=29874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=29874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}