{"id":22276,"date":"2020-09-01T12:36:54","date_gmt":"2020-09-01T12:36:54","guid":{"rendered":"https:\/\/cnsfly.com\/vytcdc\/?p=22276"},"modified":"2024-09-26T11:43:12","modified_gmt":"2024-09-26T11:43:12","slug":"docker-essentials-for-developers","status":"publish","type":"post","link":"https:\/\/cnsfly.com\/vytcdc\/docker-essentials-for-developers\/","title":{"rendered":"Docker Essentials for Developers"},"content":{"rendered":"<p data-margin-bottom=\"10.0pt\">Docker is very popular in IT world, software companies are continuously using Dockers for a production environment,<\/p>\n<p data-textformat=\"{&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(255,0,0)&quot;}\" data-margin-bottom=\"10.0pt\"><strong>History before Dockers<\/strong><\/p>\n<p data-margin-bottom=\"10.0pt\">Before Dockers, Developers have used virtual machines for running applications, but it has few disadvantages such as Virtual Machines are huge in size, it consume more memory for ram, take a lot of time to boot, and slow performance, to solve this problem, Dockers came into picture.<\/p>\n<p data-textformat=\"{&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(255,0,0)&quot;}\" data-margin-bottom=\"10.0pt\">What is Dockers?<\/p>\n<p data-textformat=\"{&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(255,0,0)&quot;}\" data-margin-bottom=\"10.0pt\">Dockers is a platform which bundle an application and all its dependencies all together and placed in a container.<\/p>\n<style>\/*! elementor - v3.23.0 - 23-07-2024 *\/<br \/>\n.elementor-widget-image{text-align:center}.elementor-widget-image a{display:inline-block}.elementor-widget-image a img[src$=\".svg\"]{width:48px}.elementor-widget-image img{vertical-align:middle;display:inline-block}<\/style>\n<p><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download.png\" alt=\"\" width=\"300\" height=\"271\" \/><\/p>\n<p data-margin-bottom=\"10.0pt\">In the above diagram, each application has separate containers, inside the container has the application files and all its dependencies and libraries, this confirms that each application works without any conflicts,<\/p>\n<p data-margin-bottom=\"10.0pt\">Using Docker a developer can build multiple containers for multiple applications, and they can place all the application dependencies and libraries inside the container, which will ensure that it will work in the testing and production environment.<\/p>\n<p data-textformat=\"{&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(255,0,0)&quot;}\" data-margin-bottom=\"10.0pt\">What is Docker file, Image and Containers?<\/p>\n<p data-margin-bottom=\"10.0pt\">Dockerfile, Docker Images &amp; Docker Containers are three important things, we need to learn about this before using Dockers.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1-1024x231.png\" sizes=\"(max-width: 640px) 100vw, 640px\" srcset=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1-1024x231.png 1024w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1-300x68.png 300w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1-768x173.png 768w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1-600x135.png 600w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1.png 1257w\" alt=\"\" width=\"640\" height=\"144\" \/><\/p>\n<p data-margin-bottom=\"10.0pt\">In the above diagram, we can see Dockerfile, Dockerimage and Docker\u00a0container<\/p>\n<p data-margin-bottom=\"10.0pt\">Dockerfile is a text document that contains all the dependencies and libraries details which help to build DockerImage, Docker will build a Docker image by reading the Dockerfile.<\/p>\n<p data-margin-bottom=\"10.0pt\">DockerImage for example, we can say Docker image is a template, which is used to create a Docker container.<\/p>\n<p data-textformat=\"{&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(23,54,93)&quot;}\" data-margin-bottom=\"10.0pt\">DockerContainer<\/p>\n<p data-margin-bottom=\"10.0pt\">Docker Container is a running instance of a Docker Image, Containers are fast and boots quickly as it uses host operating system and shares the relevant libraries, Containers has separate application dependencies and libraries which the application needed to run, Docker container will work in developer, tester and production environment without any errors.<\/p>\n<p data-textformat=\"{&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(255,0,0)&quot;}\" data-margin-bottom=\"10.0pt\">Why we use Docker Container?<\/p>\n<p data-margin-bottom=\"10.0pt\">I will explain by telling a story for the above question, A company needs to develop a java application, the developer will set up an environment with JDK and tomcat server installed in it, Once the application developed, it need send for testing, now the tester will again set up the JDK and tomcat environment for testing, once the testing is done, it will send to production again at production environment need to setup JDK and tomcat server.<\/p>\n<p data-margin-bottom=\"10.0pt\">Errors: there would be version mismatch in all three environments.<\/p>\n<p data-header=\"105\" data-margin-left=\"0.25in\" data-text-indent=\"-0.25in\" data-padding-left=\"0.25in\" data-margin-bottom=\"10.0pt\" data-hd-info=\"105\" data-list-id=\"2\" data-list-info=\"{&quot;id&quot;:2,&quot;l&quot;:0}\">1.\u00a0The application will work in the development environment but failed in the testing and production environment due to version mismatch.<\/p>\n<p data-margin-bottom=\"10.0pt\">Time: will take a lot of time for the dependency setup for the application.<\/p>\n<p data-margin-bottom=\"10.0pt\">To prevent these errors and time loss, Docker containers are used.<\/p>\n<p data-textformat=\"{&quot;fw&quot;:&quot;bold&quot;}\" data-margin-bottom=\"10.0pt\">Java Hello World program running in Docker Container<\/p>\n<p data-margin-bottom=\"10.0pt\">If you have a windows pc, download and install the docker tool application from\u00a0<a href=\"https:\/\/docs.docker.com\/\">https:\/\/docs.docker.com\/<\/a>\u00a0website.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-2.png\" sizes=\"(max-width: 509px) 100vw, 509px\" srcset=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-2.png 509w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-2-300x232.png 300w\" alt=\"\" width=\"509\" height=\"393\" \/><\/p>\n<p data-margin-bottom=\"10.0pt\">Create a folder name DockerJava\u00a0 \u00a0 \u00a0<img decoding=\"async\" id=\"60568181\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAaCAYAAADSbo4CAAAAi0lEQVRIS+2WQQ6AIAwE2z\/5P+B\/\/qmmJpDqwaJY5bBcKTAZNlAWEaEJBlsQZu5CimBvIAohsnaBMC\/0NsxcIHdsVGVqZXRYq7uRJyCjELreXvHvIDlnSikRQOrVwIgNuYYVRmDk6uFDRs52YARGvFYBGenKiKcxav7w6ekhpZSos9x9W4fmVn5QsAHWm+6zmVU2NgAAAABJRU5ErkJggg==\" alt=\"shape4\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0in any of your desired locations<\/p>\n<p data-margin-bottom=\"10.0pt\">Create a Dockerfile\u00a0 \u00a0 \u00a0<img decoding=\"async\" id=\"22437891\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAdCAYAAABIWle8AAAAeklEQVRIS2P8\/\/\/\/fwYqAUaQYYyMjBQbB3IT3LAbrzeTbaCGqC9DQ0PDqGEkhOBomJEQWFClo2E2GmY4QmCkJg3k4CC1CMcZZiAJigwDuQpUQ4EMoYphMANBNMUug4UZzIWkZCqUMEPWSG6FDK83SXEFPrXgGp1ahgEAtbDqdS3R8N8AAAAASUVORK5CYII=\" alt=\"shape5\" \/>\u00a0\u00a0\u00a0\u00a0inside that folder<\/p>\n<p data-margin-bottom=\"10.0pt\">To create a dockerfile go to cmd prompt go to you DockerJava folder location like below<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-3.png\" sizes=\"(max-width: 603px) 100vw, 603px\" srcset=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-3.png 603w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-3-300x14.png 300w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-3-590x28.png 590w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-3-600x28.png 600w\" alt=\"\" width=\"603\" height=\"28\" \/><\/p>\n<p>Inside that folder need to create Dockerfile for that run the bellow command in windows<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-4.png\" sizes=\"(max-width: 640px) 100vw, 640px\" srcset=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-4.png 654w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-4-300x14.png 300w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-4-600x28.png 600w\" alt=\"\" width=\"640\" height=\"30\" \/><\/p>\n<ul data-list-id=\"4\" data-list-format=\"{&quot;level5&quot;:{&quot;paraFormat&quot;:{&quot;ti&quot;:&quot;-0.25in&quot;,&quot;pl&quot;:&quot;0.25in&quot;,&quot;ml&quot;:&quot;2.75in&quot;,&quot;textFormat&quot;:{&quot;ff&quot;:&quot;Wingdings&quot;}},&quot;c&quot;:&quot;\uf0a7&quot;,&quot;type&quot;:8,&quot;ltype&quot;:23,&quot;startsWith&quot;:1},&quot;level4&quot;:{&quot;paraFormat&quot;:{&quot;ti&quot;:&quot;-0.25in&quot;,&quot;pl&quot;:&quot;0.25in&quot;,&quot;ml&quot;:&quot;2.25in&quot;,&quot;textFormat&quot;:{&quot;ff&quot;:&quot;TeXGyreCursor,Courier New&quot;}},&quot;c&quot;:&quot;o&quot;,&quot;type&quot;:7,&quot;ltype&quot;:23,&quot;startsWith&quot;:1},&quot;level7&quot;:{&quot;paraFormat&quot;:{&quot;ti&quot;:&quot;-0.25in&quot;,&quot;pl&quot;:&quot;0.25in&quot;,&quot;ml&quot;:&quot;3.75in&quot;,&quot;textFormat&quot;:{&quot;ff&quot;:&quot;TeXGyreCursor,Courier New&quot;}},&quot;c&quot;:&quot;o&quot;,&quot;type&quot;:7,&quot;ltype&quot;:23,&quot;startsWith&quot;:1},&quot;level6&quot;:{&quot;paraFormat&quot;:{&quot;ti&quot;:&quot;-0.25in&quot;,&quot;pl&quot;:&quot;0.25in&quot;,&quot;ml&quot;:&quot;3.25in&quot;,&quot;textFormat&quot;:{&quot;ff&quot;:&quot;Symbol&quot;}},&quot;c&quot;:&quot;\uf0b7&quot;,&quot;type&quot;:6,&quot;ltype&quot;:23,&quot;startsWith&quot;:1},&quot;level8&quot;:{&quot;paraFormat&quot;:{&quot;ti&quot;:&quot;-0.25in&quot;,&quot;pl&quot;:&quot;0.25in&quot;,&quot;ml&quot;:&quot;4.25in&quot;,&quot;textFormat&quot;:{&quot;ff&quot;:&quot;Wingdings&quot;}},&quot;c&quot;:&quot;\uf0a7&quot;,&quot;type&quot;:8,&quot;ltype&quot;:23,&quot;startsWith&quot;:1},&quot;level1&quot;:{&quot;paraFormat&quot;:{&quot;ti&quot;:&quot;-0.25in&quot;,&quot;pl&quot;:&quot;0.25in&quot;,&quot;ml&quot;:&quot;0.75in&quot;,&quot;textFormat&quot;:{&quot;ff&quot;:&quot;TeXGyreCursor,Courier New&quot;}},&quot;c&quot;:&quot;o&quot;,&quot;type&quot;:7,&quot;ltype&quot;:23,&quot;startsWith&quot;:1},&quot;level0&quot;:{&quot;paraFormat&quot;:{&quot;ti&quot;:&quot;-0.25in&quot;,&quot;pl&quot;:&quot;0.25in&quot;,&quot;ml&quot;:&quot;0.25in&quot;,&quot;textFormat&quot;:{&quot;ff&quot;:&quot;Wingdings&quot;}},&quot;c&quot;:&quot;\uf076&quot;,&quot;type&quot;:6,&quot;ltype&quot;:23,&quot;startsWith&quot;:1},&quot;level3&quot;:{&quot;paraFormat&quot;:{&quot;ti&quot;:&quot;-0.25in&quot;,&quot;pl&quot;:&quot;0.25in&quot;,&quot;ml&quot;:&quot;1.75in&quot;,&quot;textFormat&quot;:{&quot;ff&quot;:&quot;Symbol&quot;}},&quot;c&quot;:&quot;\uf0b7&quot;,&quot;type&quot;:6,&quot;ltype&quot;:23,&quot;startsWith&quot;:1},&quot;level2&quot;:{&quot;paraFormat&quot;:{&quot;ti&quot;:&quot;-0.25in&quot;,&quot;pl&quot;:&quot;0.25in&quot;,&quot;ml&quot;:&quot;1.25in&quot;,&quot;textFormat&quot;:{&quot;ff&quot;:&quot;Wingdings&quot;}},&quot;c&quot;:&quot;\uf0a7&quot;,&quot;type&quot;:8,&quot;ltype&quot;:23,&quot;startsWith&quot;:1}}\" data-spl-bullet-format=\"{}\">\n<li>\n<p data-header=\"105\" data-margin-left=\"0.25in\" data-text-indent=\"-0.25in\" data-padding-left=\"0.25in\" data-margin-bottom=\"10.0pt\" data-hd-info=\"105\" data-list-id=\"4\" data-list-info=\"{&quot;id&quot;:4,&quot;l&quot;:0}\">Now need to create a java file<\/p>\n<\/li>\n<li>\n<p data-header=\"105\" data-margin-left=\"0.25in\" data-text-indent=\"-0.25in\" data-padding-left=\"0.25in\" data-margin-bottom=\"10.0pt\" data-hd-info=\"105\" data-list-id=\"4\" data-list-info=\"{&quot;id&quot;:4,&quot;l&quot;:0}\">In the same folder create a Home.java file<\/p>\n<\/li>\n<li>\n<p data-header=\"105\" data-margin-left=\"0.25in\" data-text-indent=\"-0.25in\" data-padding-left=\"0.25in\" data-margin-bottom=\"10.0pt\" data-hd-info=\"105\" data-list-id=\"4\" data-list-info=\"{&quot;id&quot;:4,&quot;l&quot;:0}\">And copy the below java code inside the file<\/p>\n<\/li>\n<\/ul>\n<p>public\u00a0class\u00a0Home\u00a0{\u00a0\u00a0\u00a0\u00a0public\u00a0static\u00a0void\u00a0main(String[]\u00a0args)\u00a0{\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(\u201cHello\u00a0World\u201d);\u00a0\u00a0\u00a0\u00a0}}<\/p>\n<p data-margin-bottom=\"10.0pt\">Now need to create docker image by using Dockerfile<\/p>\n<p data-margin-bottom=\"10.0pt\">To create docker image copy the bellow content inside Dockerfile<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(79,129,189)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\">#Download Linux Image<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(152,72,7)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\">FROM alpine<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(152,72,7)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\">WORKDIR \/root\/JavaDocker<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(152,72,7)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\">COPY Home.java \/root\/\u00a0JavaDocker<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(79,129,189)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\"># Install java jdk in alpine os<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(152,72,7)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\">RUN apk add openjdk8<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(79,129,189)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\"># Setting Up Environment Variable<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(152,72,7)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\">ENV JAVA_HOME \/usr\/lib\/jvm\/java-1.8-openjdk<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(152,72,7)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\">ENV PATH $PATH:$JAVA_HOME\/bin<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(79,129,189)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\"># Compile the java program<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(152,72,7)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\">RUN javac Home.java<\/p>\n<p data-textformat=\"{&quot;ff&quot;:&quot;Liberation Serif,Times New Roman&quot;,&quot;fw&quot;:&quot;bold&quot;,&quot;fgc&quot;:&quot;rgb(152,72,7)&quot;,&quot;size&quot;:9}\" data-margin-bottom=\"10.0pt\">ENTRYPOINT java Home<\/p>\n<p data-margin-bottom=\"10.0pt\">The above docker file commands describe below<\/p>\n<p data-margin-bottom=\"10.0pt\">Step 1:\u00a0installing Linux image name (alpine)<\/p>\n<p data-margin-bottom=\"10.0pt\">Creating \u00a0JavaDocker directory inside the root directory<\/p>\n<p data-margin-bottom=\"10.0pt\">Copy Home.java file inside JavaDocker\u00a0folder<\/p>\n<p data-margin-bottom=\"10.0pt\">Step 2:\u00a0installing java 8 jdk<\/p>\n<p data-margin-bottom=\"10.0pt\">Then setting up environment path<\/p>\n<p data-margin-bottom=\"10.0pt\">Step 3:\u00a0Compiling and Running Home.java<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1-1024x231.png\" sizes=\"(max-width: 640px) 100vw, 640px\" srcset=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1-1024x231.png 1024w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1-300x68.png 300w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1-768x173.png 768w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1-600x135.png 600w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-1.png 1257w\" alt=\"\" width=\"640\" height=\"144\" \/><\/p>\n<p>Now need to create a docker image, to create an image run the below command<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-5.png\" sizes=\"(max-width: 640px) 100vw, 640px\" srcset=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-5.png 642w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-5-300x13.png 300w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-5-600x25.png 600w\" alt=\"\" width=\"640\" height=\"27\" \/><\/p>\n<p>If you want to give name to your docker image the use below command<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-6.png\" sizes=\"(max-width: 640px) 100vw, 640px\" srcset=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-6.png 884w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-6-300x12.png 300w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-6-768x30.png 768w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-6-600x24.png 600w\" alt=\"\" width=\"640\" height=\"25\" \/><\/p>\n<p>Now all the necessary dependency will be installed in the image<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-7.png\" sizes=\"(max-width: 640px) 100vw, 640px\" srcset=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-7.png 723w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-7-300x268.png 300w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-7-600x535.png 600w\" alt=\"\" width=\"640\" height=\"571\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-8.png\" sizes=\"(max-width: 621px) 100vw, 621px\" srcset=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-8.png 621w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-8-300x108.png 300w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-8-600x215.png 600w\" alt=\"\" width=\"621\" height=\"223\" \/><\/p>\n<p data-margin-bottom=\"10.0pt\">Now the image is successfully built<\/p>\n<p data-margin-bottom=\"10.0pt\">Now the last step we need to create and run the container<\/p>\n<p data-margin-bottom=\"10.0pt\">Run the below command to create and run the container<\/p>\n<p data-margin-bottom=\"10.0pt\">To see image list<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-9.png\" sizes=\"(max-width: 630px) 100vw, 630px\" srcset=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-9.png 630w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-9-300x16.png 300w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-9-600x32.png 600w\" alt=\"\" width=\"630\" height=\"34\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-10.png\" sizes=\"(max-width: 640px) 100vw, 640px\" srcset=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-10.png 642w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-10-300x14.png 300w, https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-10-600x27.png 600w\" alt=\"\" width=\"640\" height=\"29\" \/><\/p>\n<p>The Output we will get<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cnsfly.com\/vytcdc\/wp-content\/uploads\/2020\/09\/download-11.png\" alt=\"\" width=\"215\" height=\"36\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker is very popular in IT world, software companies are continuously using Dockers for a production environment, History before Dockers Before Dockers, Developers have used virtual machines for running applications,<\/p>\n","protected":false},"author":1,"featured_media":22784,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[77],"tags":[25,26],"class_list":["post-22276","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-design","tag-development"],"_links":{"self":[{"href":"https:\/\/cnsfly.com\/vytcdc\/wp-json\/wp\/v2\/posts\/22276","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cnsfly.com\/vytcdc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cnsfly.com\/vytcdc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cnsfly.com\/vytcdc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cnsfly.com\/vytcdc\/wp-json\/wp\/v2\/comments?post=22276"}],"version-history":[{"count":1,"href":"https:\/\/cnsfly.com\/vytcdc\/wp-json\/wp\/v2\/posts\/22276\/revisions"}],"predecessor-version":[{"id":33864,"href":"https:\/\/cnsfly.com\/vytcdc\/wp-json\/wp\/v2\/posts\/22276\/revisions\/33864"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cnsfly.com\/vytcdc\/wp-json\/wp\/v2\/media\/22784"}],"wp:attachment":[{"href":"https:\/\/cnsfly.com\/vytcdc\/wp-json\/wp\/v2\/media?parent=22276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cnsfly.com\/vytcdc\/wp-json\/wp\/v2\/categories?post=22276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cnsfly.com\/vytcdc\/wp-json\/wp\/v2\/tags?post=22276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}