{"id":2949,"date":"2018-09-26T07:00:01","date_gmt":"2018-09-26T01:30:01","guid":{"rendered":"http:\/\/www.upnxtblog.com\/?p=2949"},"modified":"2020-04-23T12:03:09","modified_gmt":"2020-04-23T06:33:09","slug":"how-to-run-multiple-services-in-a-docker-container","status":"publish","type":"post","link":"https:\/\/www.upnxtblog.com\/index.php\/2018\/09\/26\/how-to-run-multiple-services-in-a-docker-container\/","title":{"rendered":"How to run multiple services in a Docker container"},"content":{"rendered":"<div class='booster-block booster-read-block'><\/div><p><strong><a href=\"http:\/\/www.docker.com\" target=\"_blank\" rel=\"noopener\">Docker<\/a> <\/strong>as we know,is an open platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud.<\/p>\n<p>Before we move on to the actual article, some key points about containers :<\/p>\n<ul>\n<li><strong>Containers are an abstraction at the app layer<\/strong> that packages code and dependencies together. Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in userspace. Containers take up less space than VMs (container images are typically tens of MBs in size), and start almost instantly.<\/li>\n<li>A <strong>container image<\/strong> is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings.<\/li>\n<li><strong>Containers run apps natively<\/strong> on the host machine\u2019s kernel. They have better performance characteristics than virtual machines that only get virtual access to host resources through a hypervisor. Containers can get native access, each one running in a discrete process, taking no more memory than any other executable.<\/li>\n<\/ul>\n<p>By default, the main running process for Docker is the <code class=\"highlighter-rouge\">ENTRYPOINT<\/code>\u00a0and\/or\u00a0<code class=\"highlighter-rouge\">CMD<\/code>\u00a0at the end of the\u00a0<code class=\"highlighter-rouge\">Dockerfile<\/code>.Per Docker guidelines, it is recommended that you separate areas of concern by using one service per container but there could be scenarios where you would have to group services and run it in a single container.<\/p>\n<p>In this post, we are going to take look at how to run multiple services in Docker using <a href=\"http:\/\/www.supervisord.org\/\" target=\"_blank\" rel=\"noopener\">Supervisord<\/a> process manager.A supervisor is a client\/server system that allows users to monitor and control a number of processes on UNIX-like operating systems.<\/p>\n\n<h2>Step #1. Verify Docker Installation<\/h2>\n<ul>\n<li>It&#8217;s assumed that you already have Docker installation, check the installation by running following command <em>docker run hello-world<\/em>:\n<figure id=\"attachment_2934\" aria-describedby=\"caption-attachment-2934\" style=\"width: 721px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"2934\" data-permalink=\"https:\/\/www.upnxtblog.com\/index.php\/2018\/09\/19\/docker-tutorial-build-docker-image-for-your-angular-6-application\/dock14\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock14.png?fit=721%2C414&amp;ssl=1\" data-orig-size=\"721,414\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"dock14\" data-image-description=\"&lt;p&gt;Validate Docker Installation&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Image &amp;#8211; Validate Docker Installation&lt;\/p&gt;\n\" data-large-file=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock14.png?fit=721%2C414&amp;ssl=1\" class=\"wp-image-2934 size-full lazyload\" data-src=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock14.png?resize=721%2C414\" alt=\"Validate Docker Installation\" width=\"721\" height=\"414\" data-srcset=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock14.png?w=721&amp;ssl=1 721w, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock14.png?resize=300%2C172&amp;ssl=1 300w\" data-sizes=\"auto, (max-width: 721px) 100vw, 721px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 721px; --smush-placeholder-aspect-ratio: 721\/414;\" \/><figcaption id=\"caption-attachment-2934\" class=\"wp-caption-text\">Image &#8211; Validate Docker Installation<\/figcaption><\/figure>\n<p>If you need assistance on Docker installation, check out <a href=\"http:\/\/www.upnxtblog.com\/index.php\/2018\/09\/12\/how-to-install-docker-on-ubuntu\/\">here<\/a>.<\/li>\n<li>Run <em>docker &#8211;version<\/em> to check the version of the docker you\u2019re running.\n<figure id=\"attachment_2935\" aria-describedby=\"caption-attachment-2935\" style=\"width: 472px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"2935\" data-permalink=\"https:\/\/www.upnxtblog.com\/index.php\/2018\/09\/19\/docker-tutorial-build-docker-image-for-your-angular-6-application\/dock15\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock15.png?fit=472%2C52&amp;ssl=1\" data-orig-size=\"472,52\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"dock15\" data-image-description=\"&lt;p&gt;Check Docker version&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Image &amp;#8211; Check Docker version&lt;\/p&gt;\n\" data-large-file=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock15.png?fit=472%2C52&amp;ssl=1\" class=\"wp-image-2935 size-full lazyload\" data-src=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock15.png?resize=472%2C52\" alt=\"Check Docker version\" width=\"472\" height=\"52\" data-srcset=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock15.png?w=472&amp;ssl=1 472w, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock15.png?resize=300%2C33&amp;ssl=1 300w\" data-sizes=\"auto, (max-width: 472px) 100vw, 472px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 472px; --smush-placeholder-aspect-ratio: 472\/52;\" \/><figcaption id=\"caption-attachment-2935\" class=\"wp-caption-text\">Image &#8211; Check Docker version<\/figcaption><\/figure>\n<p>OK, now we have got the docker setup, the next step is to define the docker container.<\/li>\n<\/ul>\n<h2>Step #2. Create Dockerfile for our container<\/h2>\n<p>Before we move on to Dockerfile, let&#8217;s check out some overview on <em>supervisord<\/em>. Supervisor is responsible for starting child programs at its own invocation, responding to commands from clients, restarting crashed or exited subprocesses, logging its subprocess stdout and stderr output, and generating and handling \u201cevents\u201d corresponding to points in subprocess lifetimes. Supervisor process typically uses a configuration file. This is typically located in <em>\/etc\/supervisord.conf.<\/em><\/p>\n<p>For us to use Supervisord process manager in Docker, child programs, for example, Angular UI and Spring Boot Services need to be configured in <code>supervisord.conf<\/code> the file so that supervisord can spawn them during Docker initialization process.<\/p>\n<ul>\n<li>To begin with, create a new folder and then create a file in it named \u201cDockerfile\u201d with the following content.<\/li>\n<\/ul>\n<pre># Dockerfile\r\nFROM rickw\/ubuntu12-java8 \r\nMAINTAINER  Author Name author@email.com<\/pre>\n<ul>\n<li>Here I have Ubuntu 12 Image with Java 8 pre-installed as baseimage. Once we have the baseimage set, the next step is to run pre-install steps for Supervisor process manager installation.<\/li>\n<\/ul>\n<pre>#cleanup\r\nRUN add-apt-repository -r ppa:webupd8team\/java\r\nRUN apt-get update &amp;&amp; apt-get install -y apache2 &amp;&amp; apt-get clean &amp;&amp; rm -rf \/var\/lib\/apt\/lists\/*\r\nRUN \\\r\n\u00a0 sed -i 's\/# \\(.*multiverse$\\)\/\\1\/g' \/etc\/apt\/sources.list &amp;&amp; \\\r\napt-get update &amp;&amp; \\\r\napt-get -y upgrade<\/pre>\n<ul>\n<li>In this step, we are installing Supervisor process manager and create folders for storing configuration<\/li>\n<\/ul>\n<pre># supervisor installation &amp;&amp;\r\n# create directory for child images to store configuration in\r\nRUN apt-get -y install supervisor &amp;&amp; \\\r\n\u00a0 mkdir -p \/var\/log\/supervisor &amp;&amp; \\\r\n\u00a0 mkdir -p \/etc\/supervisor\/conf.d<\/pre>\n<ul>\n<li>Next is to copy the Angular application and Spring Boot executable to container<\/li>\n<\/ul>\n<pre style=\"padding-left: 60px;\"><code>RUN mkdir \/usr\/api\r\nWORKDIR \/usr\/api\r\n\r\n# Add API Executable jar\r\nCOPY myapp-api-0.0.1-SNAPSHOT.jar \/usr\/api\/app.jar\r\n\r\n# Add Dist folder for Angular app\r\nCOPY dist\/ \/usr\/local\/apache2\/htdocs\/\r\nCOPY .htaccess \/usr\/local\/apache2\/htdocs\/\r\nRUN chmod -R 755 \/usr\/local\/apache2\/htdocs\/\r\nCOPY httpd.conf \/usr\/local\/apache2\/conf\/httpd.conf<\/code><\/pre>\n<ul>\n<li>Add Supervisor.conf base configuration file to container. Configuration file would have all child programs and their respective start commands, configuration, etc.,<\/li>\n<\/ul>\n<pre style=\"padding-left: 60px;\"><code># supervisor base configuration \r\nADD supervisor.conf \/etc\/supervisor.conf<\/code><\/pre>\n<ul>\n<li>Finally, add command for docker\u2019s init system<\/li>\n<\/ul>\n<pre style=\"padding-left: 60px;\"># default command\r\nCMD [\"supervisord\", \"-c\", \"\/etc\/supervisor.conf\"]<\/pre>\n<ul>\n<li>Finally, Docker file would now be looking like the one below<\/li>\n<\/ul>\n<pre style=\"padding-left: 60px;\">FROM rickw\/ubuntu12-java8\r\n#cleanup\r\nRUN add-apt-repository -r ppa:webupd8team\/java\r\nRUN apt-get update &amp;&amp; apt-get install -y apache2 &amp;&amp; apt-get clean &amp;&amp; rm -rf \/var\/lib\/apt\/lists\/*\r\nRUN \\\r\n\u00a0 sed -i 's\/# \\(.*multiverse$\\)\/\\1\/g' \/etc\/apt\/sources.list &amp;&amp; \\\r\n\u00a0 apt-get update &amp;&amp; \\\r\n\u00a0 apt-get -y upgrade\r\n\r\n# supervisor installation &amp;&amp;\r\n# create directory for child images to store configuration in\r\nRUN apt-get -y install supervisor &amp;&amp; \\\r\n\u00a0 mkdir -p \/var\/log\/supervisor &amp;&amp; \\\r\n\u00a0 mkdir -p \/etc\/supervisor\/conf.d\r\nRUN mkdir \/usr\/api\r\nWORKDIR \/usr\/api\r\n\r\n# Add API Executable jar\r\nCOPY myapp-api-0.0.1-SNAPSHOT.jar \/usr\/api\/app.jar\r\n\r\n# Add Dist folder\r\nCOPY dist\/ \/usr\/local\/apache2\/htdocs\/\r\nCOPY .htaccess \/usr\/local\/apache2\/htdocs\/\r\nRUN chmod -R 755 \/usr\/local\/apache2\/htdocs\/\r\nCOPY httpd.conf \/usr\/local\/apache2\/conf\/httpd.conf\r\n\r\n# supervisor base configuration\r\nADD supervisor.conf \/etc\/supervisor.conf\r\n\r\n# default command\r\nCMD [\"supervisord\", \"-c\", \"\/etc\/supervisor.conf\"]\r\n\r\n<\/pre>\n<ul>\n<li>Supervisor configuration file<\/li>\n<\/ul>\n<pre style=\"padding-left: 60px;\">[supervisord]\r\nnodaemon=true\r\n\r\n[program:apache2]\r\ncommand=service apache2 restart\r\nkillasgroup=true\r\nstopasgroup=true\r\nredirect_stderr=true\r\n\r\n[program:springbootapp]\r\ndirectory=\/usr\/api\r\ncommand=\/bin\/bash -c \"java -jar app.jar\"\r\nstdout_logfile=\/var\/log\/supervisor\/%(program_name)s.log\r\nstderr_logfile=\/var\/log\/supervisor\/%(program_name)s.log<\/pre>\n<h2>Step #3. Build\u00a0Docker Image<\/h2>\n<p>Now that we have completed Dockerfile and also have Supervisor configuration file ready, the next step is to build Docker image by <em>docker build command\u00a0<\/em><\/p>\n<pre>docker build -t orderapp .<\/pre>\n<p>Here -t specifies the name of the image.<\/p>\n<figure id=\"attachment_2953\" aria-describedby=\"caption-attachment-2953\" style=\"width: 727px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"2953\" data-permalink=\"https:\/\/www.upnxtblog.com\/index.php\/2018\/09\/26\/how-to-run-multiple-services-in-a-docker-container\/dock-super\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock-super.png?fit=727%2C575&amp;ssl=1\" data-orig-size=\"727,575\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"dock-super\" data-image-description=\"&lt;p&gt;Docker build for running multiple process using Supervisor&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Image &amp;#8211; Docker build for running multiple process using Supervisor&lt;\/p&gt;\n\" data-large-file=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock-super.png?fit=727%2C575&amp;ssl=1\" class=\"wp-image-2953 size-full lazyload\" data-src=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock-super.png?resize=727%2C575\" alt=\"Docker build for running multiple process using Supervisor\" width=\"727\" height=\"575\" data-srcset=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock-super.png?w=727&amp;ssl=1 727w, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/dock-super.png?resize=300%2C237&amp;ssl=1 300w\" data-sizes=\"auto, (max-width: 727px) 100vw, 727px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 727px; --smush-placeholder-aspect-ratio: 727\/575;\" \/><figcaption id=\"caption-attachment-2953\" class=\"wp-caption-text\">Image &#8211; Docker build for running multiple process using Supervisor<\/figcaption><\/figure>\n<p>Logs for both applications can be located at\u00a0<code>\/var\/log\/supervisor\/***.log<\/code><\/p>\n<p><em>Congrats! We have successfully built a container for our application with Supervisor process manager.<\/em><\/p>\n<h2>Step #4. Test Docker Image<\/h2>\n<p>To run the Docker image, execute the following commands<\/p>\n<pre>docker run -p 4200:4200 orderapp<\/pre>\n<p>Here -p specifies the port container: host mapping.<\/p>\n<p>Launch your browser and hit <code>http:\/\/localhost:4200<\/code> to access the application running on your container.<\/p>\n<figure id=\"attachment_2893\" aria-describedby=\"caption-attachment-2893\" style=\"width: 918px\" class=\"wp-caption alignnone\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"2893\" data-permalink=\"https:\/\/www.upnxtblog.com\/index.php\/2018\/09\/07\/how-to-deploy-angular-6-spring-boot-app-as-single-deployment-unit\/ang18-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/ang18-1.png?fit=918%2C623&amp;ssl=1\" data-orig-size=\"918,623\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ang18\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/ang18-1.png?fit=918%2C623&amp;ssl=1\" class=\"wp-image-2893 size-full lazyload\" data-src=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/ang18-1.png?resize=918%2C623\" alt=\"Angular application served from container\" width=\"918\" height=\"623\" data-srcset=\"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/ang18-1.png?w=918&amp;ssl=1 918w, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/ang18-1.png?resize=300%2C204&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/09\/ang18-1.png?resize=768%2C521&amp;ssl=1 768w\" data-sizes=\"auto, (max-width: 918px) 100vw, 918px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 918px; --smush-placeholder-aspect-ratio: 918\/623;\" \/><figcaption id=\"caption-attachment-2893\" class=\"wp-caption-text\">Image &#8211; Angular application served from container<\/figcaption><\/figure>\n<p><em>Congrats! We have successfully built and run a container for running multiple services using Supervisor. <\/em>There is much more to the Docker platform than what was covered here, but now you would have got a good idea of the basics of building containers for an application.<\/p>\n<p><em><strong>Like this post? Don\u2019t forget to share it!<\/strong><\/em><\/p>\n<h2>Additional Resources:<\/h2>\n<ul>\n<li><a href=\"https:\/\/docs.docker.com\/reference\/builder\/\" target=\"_blank\" rel=\"noopener\">Official documentation<\/a> as a reference to understand any command.<\/li>\n<li><a title=\"Docker build reference\" href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/build\/\" target=\"_blank\" rel=\"noopener noreferrer\">Docker build reference<\/a><\/li>\n<li><a title=\"Docker run reference\" href=\"https:\/\/docs.docker.com\/engine\/reference\/run\/\" target=\"_blank\" rel=\"noopener noreferrer\">Docker run reference<\/a><\/li>\n<li><a href=\"https:\/\/www.upnxtblog.com\/index.php\/2018\/01\/17\/top-6-gui-tools-for-managing-docker-environments\/\">TOP 6 GUI tools for managing Docker environments<\/a><\/li>\n<li><a href=\"https:\/\/www.upnxtblog.com\/index.php\/2017\/11\/29\/docker-tutorial-build-docker-image-for-your-java-application\/\">Docker tutorial \u2013 Build Docker image for your Java application<\/a><\/li>\n<li><a href=\"https:\/\/docs.docker.com\/articles\/dockerfile_best-practices\/\" target=\"_blank\" rel=\"noopener\">Best Practices<\/a> article on writing Docker files.<\/li>\n<li><a href=\"https:\/\/docs.docker.com\/\" target=\"_blank\" rel=\"noopener\">Test<\/a> your knowledge on Dockerfile.<\/li>\n<li><a href=\"https:\/\/www.upnxtblog.com\/index.php\/2019\/01\/10\/how-to-aggregate-docker-container-logs-and-analyse-with-elk-stack\/\">How to aggregate Docker Container logs and analyse with ELK stack ?<\/a><\/li>\n<li><a href=\"https:\/\/www.upnxtblog.com\/index.php\/2019\/01\/04\/implementing-secure-containers-using-gvisordocker-tutorial\/\">Implementing secure containers using gVisor+Docker tutorial<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Docker as we know,is an open platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud. Before we move on to the actual article, some key points about containers : Containers are an abstraction at the app layer that packages code and dependencies together. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1061,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[310,146,37],"tags":[53,294],"class_list":["post-2949","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","category-cloud","category-how-to-guides","tag-docker","tag-supervisor"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/11\/docker_facebook_share.png?fit=336%2C287&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9fbQS-Lz","jetpack-related-posts":[{"id":415,"url":"https:\/\/www.upnxtblog.com\/index.php\/2017\/09\/07\/10-things-know-containerization-technology\/","url_meta":{"origin":2949,"position":0},"title":"10 things you should know about containerization technology","author":"Karthik","date":"September 7, 2017","format":false,"excerpt":"Linux containers have been around since the early 2000s and architected into Linux in 2007. Due to the small footprint and portability of containers, the same hardware can support an exponentially larger number of containers than VMs, dramatically reducing infrastructure costs and enabling more apps to deploy faster. But due\u2026","rel":"","context":"In &quot;Cloud Computing&quot;","block_context":{"text":"Cloud Computing","link":"https:\/\/www.upnxtblog.com\/index.php\/category\/cloud\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/09\/container2.png?fit=638%2C343&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/09\/container2.png?fit=638%2C343&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/09\/container2.png?fit=638%2C343&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":1748,"url":"https:\/\/www.upnxtblog.com\/index.php\/2018\/01\/17\/top-6-gui-tools-for-managing-docker-environments\/","url_meta":{"origin":2949,"position":1},"title":"TOP 6 GUI tools for managing Docker environments","author":"Karthik","date":"January 17, 2018","format":false,"excerpt":"Before we start, a little bit of intro on Containers, its an abstraction at the app layer that packages code and dependencies together. Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in userspace. Containers take up less\u2026","rel":"","context":"In &quot;Docker Guides&quot;","block_context":{"text":"Docker Guides","link":"https:\/\/www.upnxtblog.com\/index.php\/category\/docker\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/01\/dashboard.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/01\/dashboard.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/01\/dashboard.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/01\/dashboard.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2018\/01\/dashboard.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":2273,"url":"https:\/\/www.upnxtblog.com\/index.php\/2018\/04\/11\/create-docker-images-using-multi-stage-builds\/","url_meta":{"origin":2949,"position":2},"title":"Docker tutorial &#8211; Create Docker Images using Multi-stage builds","author":"Karthik","date":"April 11, 2018","format":false,"excerpt":"From the last post, we have understood what is container & why do we use containers in general. Just to recap here are some of the key points Containers are an abstraction at the app layer that packages code and dependencies together. Multiple containers can run on the same machine\u2026","rel":"","context":"In &quot;Docker Guides&quot;","block_context":{"text":"Docker Guides","link":"https:\/\/www.upnxtblog.com\/index.php\/category\/docker\/"},"img":{"alt_text":"Docker","src":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/11\/dock1.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/11\/dock1.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/11\/dock1.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/11\/dock1.png?resize=700%2C400 2x"},"classes":[]},{"id":2336,"url":"https:\/\/www.upnxtblog.com\/index.php\/2018\/04\/20\/docker-tutorial-swarm-mode\/","url_meta":{"origin":2949,"position":3},"title":"Docker tutorial &#8211; Create,Add Nodes,Deploy and Scale service on the Swarm","author":"Karthik","date":"April 20, 2018","format":false,"excerpt":"From the last post, we have understood what is container & why do we use containers in general. Just to recap here are some of the key points Containers are an abstraction at the app layer that packages code and dependencies together. Multiple containers can run on the same machine\u2026","rel":"","context":"In &quot;Docker Guides&quot;","block_context":{"text":"Docker Guides","link":"https:\/\/www.upnxtblog.com\/index.php\/category\/docker\/"},"img":{"alt_text":"Docker","src":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/11\/dock1.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/11\/dock1.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/11\/dock1.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/11\/dock1.png?resize=700%2C400 2x"},"classes":[]},{"id":3179,"url":"https:\/\/www.upnxtblog.com\/index.php\/2019\/01\/04\/implementing-secure-containers-using-gvisordocker-tutorial\/","url_meta":{"origin":2949,"position":4},"title":"Implementing secure containers using gVisor+Docker tutorial","author":"Karthik","date":"January 4, 2019","format":false,"excerpt":"Linux containers have been around since the early 2000s and architected into Linux in 2007. Due to the small footprint and portability of containers, the same hardware can support an exponentially larger number of containers than VMs, dramatically reducing infrastructure costs and enabling more apps to deploy faster. But due\u2026","rel":"","context":"In &quot;Docker Guides&quot;","block_context":{"text":"Docker Guides","link":"https:\/\/www.upnxtblog.com\/index.php\/category\/docker\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/10\/google_chrome-logo.png?fit=800%2C473&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/10\/google_chrome-logo.png?fit=800%2C473&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/10\/google_chrome-logo.png?fit=800%2C473&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2017\/10\/google_chrome-logo.png?fit=800%2C473&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":4831,"url":"https:\/\/www.upnxtblog.com\/index.php\/2020\/01\/29\/take-look-at-podman-red-hats-daemon-less-docker-alternative\/","url_meta":{"origin":2949,"position":5},"title":"Take look at Podman, Red Hat&#8217;s daemon-less Docker Alternative","author":"Karthik","date":"January 29, 2020","format":false,"excerpt":"Podman is a new, open-source, container engine that works seamlessly with containers as well as pods. This project is different because it doesn\u2019t actually depend on a daemon(like Docker), but instead launches containers and pods as child processes. Podman is the CLI tool for interacting with libpod, a library that\u2026","rel":"","context":"In &quot;Docker Guides&quot;","block_context":{"text":"Docker Guides","link":"https:\/\/www.upnxtblog.com\/index.php\/category\/docker\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2020\/01\/podman.jpg?fit=880%2C218&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2020\/01\/podman.jpg?fit=880%2C218&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2020\/01\/podman.jpg?fit=880%2C218&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.upnxtblog.com\/wp-content\/uploads\/2020\/01\/podman.jpg?fit=880%2C218&ssl=1&resize=700%2C400 2x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.upnxtblog.com\/index.php\/wp-json\/wp\/v2\/posts\/2949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.upnxtblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.upnxtblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.upnxtblog.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.upnxtblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=2949"}],"version-history":[{"count":13,"href":"https:\/\/www.upnxtblog.com\/index.php\/wp-json\/wp\/v2\/posts\/2949\/revisions"}],"predecessor-version":[{"id":5406,"href":"https:\/\/www.upnxtblog.com\/index.php\/wp-json\/wp\/v2\/posts\/2949\/revisions\/5406"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.upnxtblog.com\/index.php\/wp-json\/wp\/v2\/media\/1061"}],"wp:attachment":[{"href":"https:\/\/www.upnxtblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=2949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.upnxtblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=2949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.upnxtblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=2949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}