{"id":3259,"date":"2017-09-05T15:53:51","date_gmt":"2017-09-05T15:53:51","guid":{"rendered":"https:\/\/cloudkul.com\/blog\/?p=3259"},"modified":"2018-07-18T10:23:59","modified_gmt":"2018-07-18T10:23:59","slug":"magento-2-docker-installation","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/","title":{"rendered":"Magento 2 Docker Installation"},"content":{"rendered":"<p>Be it developers, or sys-admins, or devops engineers, all of them\u00a0must have came across Docker once in a while. For those who haven&#8217;t heard of this term, Docker is a kind of virtualisation like vagrant, virtual machines etc. Quoting from Docker documentation itself:<\/p>\n<blockquote><p><strong><em>Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications.<\/em><\/strong><\/p><\/blockquote>\n<h2><strong>Understanding Docker Architecture:<\/strong><\/h2>\n<p>&nbsp;<\/p>\n<p>Docker engine is a client-server application which has basically three components,<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>Docker daemon server<\/li>\n<li>REST API that provides an interface so that programs can talk to docker daemon and give it instructions.<\/li>\n<li>Docker command line interface<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>The CLI uses REST API to control or interact with \u00a0Docker daemon through CLI commands. Docker engine architecture from Docker docs itself is shown below:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2017\/09\/engine-components-flow.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3275\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2017\/09\/engine-components-flow.png\" alt=\"\" width=\"492\" height=\"385\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Docker packages and runs an application in a loosely isolated environment called a container. Unlike VMs, containers do not bundle a full operating system. They wrap up only libraries and settings required to make software work.\u00a0Containers get launched from docker image(s). Docker container image is a light-weight, standalone, executable package of a piece of software that is code, system tools, system libraries, settings etc. They are constructed from filesystem layers and share common files.<\/p>\n<p>Containers running on single machine share that machine&#8217;s operating system kernel. That is why they start instantly and use less compute and RAM. Containers also share OS kernel with other containers as well. They are abstraction at the application layer that package code and dependencies together. A layered architecture of docker (taken from www.slideshare.net) is shown below:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2017\/09\/docker-14-638.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3278\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2017\/09\/docker-14-638.jpg\" alt=\"\" width=\"638\" height=\"359\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Images can either be created by launching containers from some base image followed by some installations\/alterations and then committing the container to a new image, or it can be created from Dockerfile. For creating an image, writing Dockerfile happens to be a good practice \u00a0as it is light-weight \u00a0and image built from Dockerfile consume less storage space.<\/p>\n<p>Dockerfile allows to create image either from some base image (ex: ubuntu os image) or directly from scratch where we define all the packages that would be needed in our image. For best practices for writing Dockerfile, refer link\u00a0<a href=\"https:\/\/docs.docker.com\/engine\/userguide\/eng-image\/dockerfile_best-practices\/\">https:\/\/docs.docker.com\/engine\/userguide\/eng-image\/dockerfile_best-practices\/\u00a0<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h2>Magento 2 With Docker:<\/h2>\n<p>&nbsp;<\/p>\n<p>Docker is an open-source project that can be integrated with almost all the applications allowing scope of isolation and flexibility. It can be integrated with Magento-2.x as well.\u00a0Magento\u00a0is an e-commerce platform written in PHP and based on zend framework available under\u00a0both open-source and commercial licenses. In this blog, we will run magento2.x within the architecture of docker on Ubuntu 16.04.<\/p>\n<p>Generally, &#8220;each container should have only one concern&#8221; i.e. there should be single process running per containers. Then all the running containers should be linked with each other. But in the architecture we will be defining in this blog, we will use supervisor as our main process that will run apache server and mysql server together within a single container. Hence we won&#8217;t need container linking.<\/p>\n<p>Also, supervisor is a client-server system that monitors and controls a number of processes. In our later blogs, we will explore architectures built on multiple containers and their linking mechanism.<\/p>\n<p>Presuming the fact that Docker is already installed on your ubuntu server, we will dive into server setup. If Docker is not installed on your server, <a href=\"https:\/\/docs.docker.com\/engine\/installation\/linux\/docker-ce\/ubuntu\/\">please install the docker beforehand<\/a>. Moving forward to our architecture setup, we will create a Dockerfile that will hold the installation of LAMP server and other necessary packages.<\/p>\n<p><em><strong>To begin with, we will be using Ubuntu 16.04 base image, apache2 server, mysql-server-5.7 and PHP version will be passed as an argument as per your choice (php7.0, php7.1) along its <a href=\"https:\/\/cloudkul.com\/knowledgebase\/php-7-extensions-required-magento-2-x-server\/\">extensions<\/a>\u00a0as per Magento 2.x requirements. <\/strong><\/em><\/p>\n<p>Whole server architecture will be wrapped up in one Docker image and <em><strong>Magento-2.x files will be placed on our host. It is a good practice to keep application on host so that it will not be lost if containers or images get accidentally removed. These magento files will be mapped from host to docker containers<\/strong>.<\/em> We will also install supervisor for controlling apache and mysql server.<\/p>\n<p>Dockerfile is shown below:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">FROM ubuntu:16.04\r\n \r\nLABEL maintainer=\"Alankrit Srivastava &lt;alankrit.srivastava256@webkul.com&gt;\"\r\n\r\n## Mysql root password and PHP version to be passed as arguments while building image\r\nARG mysql_password\r\nARG phpV\r\nENV MYSQL_ROOT_PASSWORD {mysql_password}\r\n\r\n## Update Server and Install LAMP\r\n \r\nRUN apt-get update \\\r\n    &amp;&amp; apt-get -y install apache2 \\\r\n    &amp;&amp; a2enmod rewrite \\\r\n    &amp;&amp; a2enmod headers \\\r\n    &amp;&amp; export LANG=en_US.UTF-8 \\\r\n    &amp;&amp; apt-get update \\\r\n    &amp;&amp; apt-get install -y software-properties-common \\\r\n    &amp;&amp; apt-get install -y language-pack-en-base \\\r\n    &amp;&amp; LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej\/php \\\r\n    &amp;&amp; apt-get update \\\r\n    &amp;&amp; apt-get -y install php${phpV} php${phpV}-curl php${phpV}-intl php${phpV}-gd php${phpV}-dom \\\r\n    php${phpV}-mcrypt php${phpV}-iconv php${phpV}-xsl php${phpV}-mbstring php${phpV}-ctype php${phpV}-zip \\\r\n    php${phpV}-pdo php${phpV}-xml php${phpV}-bz2 php${phpV}-calendar php${phpV}-exif php${phpV}-fileinfo php${phpV}-json \\\r\n    php${phpV}-mysqli php${phpV}-mysql php${phpV}-posix php${phpV}-tokenizer php${phpV}-xmlwriter php${phpV}-xmlreader \\\r\n    php${phpV}-phar php${phpV}-soap php${phpV}-mysql php${phpV}-fpm php${phpV}-bcmath libapache2-mod-php${phpV} \\\r\n    &amp;&amp; sed -i -e\"s\/^memory_limit\\s*=\\s*128M\/memory_limit = 512M\/\" \/etc\/php\/${phpV}\/apache2\/php.ini \\\r\n    &amp;&amp; rm \/var\/www\/html\/* \\\r\n    &amp;&amp; sed -i \"s\/None\/all\/g\" \/etc\/apache2\/apache2.conf \\\r\n    &amp;&amp; apt-get -y install debconf-utils \\\r\n    &amp;&amp; echo \"mysql-server-5.7 mysql-server\/root_password password ${mysql_password}\" | debconf-set-selections \\\r\n    &amp;&amp; echo \"mysql-server-5.7 mysql-server\/root_password_again password ${mysql_password}\" | debconf-set-selections \\\r\n    &amp;&amp; DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.7 &amp;&amp; \\\r\n    mkdir -p \/var\/lib\/mysql &amp;&amp; \\\r\n    mkdir -p \/var\/run\/mysqld &amp;&amp; \\\r\n    mkdir -p \/var\/log\/mysql &amp;&amp; \\\r\n    touch \/var\/run\/mysqld\/mysqld.sock &amp;&amp; \\\r\n    touch \/var\/run\/mysqld\/mysqld.pid &amp;&amp; \\\r\n    chown -R mysql:mysql \/var\/lib\/mysql &amp;&amp; \\\r\n    chown -R mysql:mysql \/var\/run\/mysqld &amp;&amp; \\\r\n    chown -R mysql:mysql \/var\/log\/mysql &amp;&amp;\\\r\n    chmod -R 777 \/var\/run\/mysqld\/ \\\r\n    &amp;&amp; sed -i -e\"s\/^bind-address\\s*=\\s*127.0.0.1\/bind-address = 0.0.0.0\/\" \/etc\/mysql\/mysql.conf.d\/mysqld.cnf \\\r\n##install supervisor and setup supervisord.conf file\r\n    &amp;&amp; apt-get install -y supervisor \\\r\n    &amp;&amp; mkdir -p \/var\/log\/supervisor\r\nENV APACHE_RUN_USER    www-data\r\nENV APACHE_RUN_GROUP   www-data\r\nENV APACHE_PID_FILE    \/var\/run\/apache2.pid\r\nENV APACHE_RUN_DIR     \/var\/run\/apache2\r\nENV APACHE_LOCK_DIR    \/var\/lock\/apache2\r\nENV APACHE_LOG_DIR     \/var\/log\/apache2\r\nENV LANG               C\r\nWORKDIR \/var\/www\/html\r\nCOPY supervisord.conf \/etc\/supervisor\/conf.d\/supervisord.conf\r\n## Copy one time database creation script from host to docker.\r\nCOPY mysql.sh \/etc\/mysql.sh\r\nRUN chmod a+x \/etc\/mysql.sh\r\n## Expose ports for web server and database server.\r\nEXPOSE 3306 80\r\nCMD [\"\/usr\/bin\/supervisord\"]<\/pre>\n<p>&nbsp;<\/p>\n<p>Take a note that Dockerfile just install packages as it is instructed to do by the commands and build the image.<\/p>\n<p>Consider image as rest package where no services or processes are running. That is why we cannot perform any operation from Dockerfile that requires a particular service to be running. <em><strong>As with case of database, we cannot create database from Dockerfile as mysql service is not running. For database and its user creation, we will create a bash script that will run whenever a container will launch, hence creating mentioned database and its user.<\/strong> <\/em><\/p>\n<p>We are using &#8220;mysql.sh&#8221; as the bash script as mentioned in Dockerfile. Bash script &#8220;msyql.sh&#8221; resides on our host parallel to Dockerfile.<\/p>\n<p>Contents of mysql.sh is shown below:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">#!\/bin\/bash\r\n\r\nset -u\r\nsleep 4\r\ndatabase_connectivity_check=no\r\nvar=1\r\nwhile [ \"$database_connectivity_check\" != \"mysql\" ]; do\r\n\/etc\/init.d\/mysql start\r\nsleep 2\r\ndatabase_connectivity_check=`mysqlshow --user=root --password=$MYSQL_ROOT_PASSWORD | grep -o mysql`\r\nif [ $var -ge 4 ]; then\r\nexit 1\r\nfi\r\nvar=$((var+1))\r\ndone\r\n\r\n\r\ndatabase_availability_check=`mysqlshow --user=root --password=$MYSQL_ROOT_PASSWORD | grep -ow \"$MYSQL_DATABASE\"`\r\n\r\nif [ \"$database_availability_check\" == \"$MYSQL_DATABASE\" ]; then\r\nexit 1\r\nelse\r\nmysql -u root -p$MYSQL_ROOT_PASSWORD -e \"grant all on *.* to 'root'@'%' identified by '$MYSQL_ROOT_PASSWORD';\"\r\nmysql -u root -p$MYSQL_ROOT_PASSWORD -e \"create database $MYSQL_DATABASE;\"\r\nmysql -u root -p$MYSQL_ROOT_PASSWORD -e \"grant all on $MYSQL_DATABASE.* to 'root'@'%' identified by '$MYSQL_ROOT_PASSWORD';\"\r\nsupervisorctl stop database_creation &amp;&amp; supervisorctl remove database_creation\r\necho \"Database $MYSQL_DATABASE created\"\r\nfi\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Apart from mysql.sh file, we are copying supervisord.conf file from host to docker image that holds that instructions to run apache2 server, mysql server, mysql.sh script and certain ownership command. This file should be placed to Dockerfile and mysql.sh script.<\/p>\n<p>Contents of supervisord.conf file is shown below:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">[supervisord]\r\nnodaemon=true\r\n \r\n[program:mysql]\r\ncommand=\/bin\/bash -c \"touch \/var\/run\/mysqld\/mysqld.sock;touch \/var\/run\/mysqld\/mysqld.pid;chown -R mysql:mysql \/var\/lib\/mysql;chown -R mysql:mysql \/var\/run\/mysqld;chown -R mysql:mysql \/var\/log\/mysql;chmod -R 777 \/var\/run\/mysqld\/;\/etc\/init.d\/mysql restart\"\r\n  \r\n[program:apache2]\r\ncommand=\/bin\/bash -c \"source \/etc\/apache2\/envvars &amp;&amp; exec \/usr\/sbin\/apache2 -DFOREGROUND\"\r\n \r\n[program:command_for_user_permission]\r\ncommand=\/bin\/bash -c \"chown -R www-data: \/var\/www\/\"\r\n\r\n[program:database_creation]\r\ncommand=\/bin\/bash -c \"\/etc\/mysql.sh\"\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Our parent directory will have following files\/directories:<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>Dockerfile<\/li>\n<li>supervisord.conf<\/li>\n<li>mysql.sh<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Now when Dockerfile, mysql.sh, supervisord.conf, 000-default.conf and magento2 directory are placed parallel to each other, we are ready to build our image. Go to your docker project directory and run:<\/p>\n<pre class=\"lang:default decode:true \">docker build --build-arg mysql_password=mention_mysql_password \\\r\n--build-arg phpV=mention_php_version -t image_name:image_tag .<\/pre>\n<p>After image build up, you can check your built images by command:<\/p>\n<pre class=\"lang:default decode:true\">docker images<\/pre>\n<p>As mentioned earlier, we will keeping Magento server files on host. So create a directory naming magento2 parallel to Dockerfile. Download the latest Magento-2.x from<a href=\"https:\/\/magento.com\/tech-resources\/download\">\u00a0https:\/\/magento.com\/tech-resources\/download<\/a>\u00a0and place the unarchived files within magento2 directory and change its ownership as www-data.<\/p>\n<p>Now for running containers from this image, first ensure you have port 80 and 3306 is available then run the command:<\/p>\n<pre class=\"lang:default decode:true \">\u00a0docker run -d -p 80:80 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mention_mysql_password \\\r\n -e MYSQL_DATABASE=mention_database -v `pwd`\/magento2:\/var\/www\/html\/ --name container_name \\\r\n  image_name:image_tag<\/pre>\n<p>In above command, &#8220;-v&#8221; is used to mount or map volumes. In our case it is mapping magento2 directory with \/var\/www\/html\/. \u00a0After running above command, check the running containers by command:<\/p>\n<pre class=\"lang:default decode:true \">docker ps<\/pre>\n<p>Now hit the URL or IP on your browser and you will see the magento-2.x installation page.<\/p>\n<p>So far, we have setup Magento-2.x within the Docker architecture with running single container for web server &amp; database server and mapping Magento-2.x files from host to docker container. In our next blog, we will build docker architecture for Magento-2.x by container linking approach.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/cloudkul.com\/contact\/\">IN CASE OF ANY QUERY,CONTACT US<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Be it developers, or sys-admins, or devops engineers, all of them\u00a0must have came across Docker <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":7,"featured_media":3297,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[35,86,1],"tags":[188,187],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Magento 2 Docker Installation - Cloudkul<\/title>\n<meta name=\"description\" content=\"Docker is an open-source project that can be integrated with almost all the applications allowing scope of isolation and flexibility. It can be integrated with Magento-2.x as well. Magento is an e-commerce platform written in PHP and based on zend framework available under both open-source and commercial licenses. In this blog, we will run magento2.x within the architecture of docker on Ubuntu 16.04. Generally, &quot;each container should have only one concern&quot; i.e. there should be single process running per containers. Then all the running containers should be linked with each other. But in the architecture we will be defining in this blog, we will use supervisor as our main process that will run apache server and mysql server together within a single container. Hence we won&#039;t need container linking.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento 2 Docker Installation - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"Docker is an open-source project that can be integrated with almost all the applications allowing scope of isolation and flexibility. It can be integrated with Magento-2.x as well. Magento is an e-commerce platform written in PHP and based on zend framework available under both open-source and commercial licenses. In this blog, we will run magento2.x within the architecture of docker on Ubuntu 16.04. Generally, &quot;each container should have only one concern&quot; i.e. there should be single process running per containers. Then all the running containers should be linked with each other. But in the architecture we will be defining in this blog, we will use supervisor as our main process that will run apache server and mysql server together within a single container. Hence we won&#039;t need container linking.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2017-09-05T15:53:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-07-18T10:23:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2017\/09\/download.png\" \/>\n\t<meta property=\"og:image:width\" content=\"848\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Alankrit Srivastava\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/\",\"name\":\"Magento 2 Docker Installation - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2017-09-05T15:53:51+00:00\",\"dateModified\":\"2018-07-18T10:23:59+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16\"},\"description\":\"Docker is an open-source project that can be integrated with almost all the applications allowing scope of isolation and flexibility. It can be integrated with Magento-2.x as well. Magento is an e-commerce platform written in PHP and based on zend framework available under both open-source and commercial licenses. In this blog, we will run magento2.x within the architecture of docker on Ubuntu 16.04. Generally, \\\"each container should have only one concern\\\" i.e. there should be single process running per containers. Then all the running containers should be linked with each other. But in the architecture we will be defining in this blog, we will use supervisor as our main process that will run apache server and mysql server together within a single container. Hence we won't need container linking.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Magento 2 Docker Installation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16\",\"name\":\"Alankrit Srivastava\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Alankrit Srivastava\"},\"description\":\"DevOps Manager at Webkul Software Privated Limited\",\"sameAs\":[\"http:\/\/cloudkul.com\"],\"url\":\"https:\/\/cloudkul.com\/blog\/author\/alankrit-srivastava256\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Magento 2 Docker Installation - Cloudkul","description":"Docker is an open-source project that can be integrated with almost all the applications allowing scope of isolation and flexibility. It can be integrated with Magento-2.x as well. Magento is an e-commerce platform written in PHP and based on zend framework available under both open-source and commercial licenses. In this blog, we will run magento2.x within the architecture of docker on Ubuntu 16.04. Generally, \"each container should have only one concern\" i.e. there should be single process running per containers. Then all the running containers should be linked with each other. But in the architecture we will be defining in this blog, we will use supervisor as our main process that will run apache server and mysql server together within a single container. Hence we won't need container linking.","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:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/","og_locale":"en_US","og_type":"article","og_title":"Magento 2 Docker Installation - Cloudkul","og_description":"Docker is an open-source project that can be integrated with almost all the applications allowing scope of isolation and flexibility. It can be integrated with Magento-2.x as well. Magento is an e-commerce platform written in PHP and based on zend framework available under both open-source and commercial licenses. In this blog, we will run magento2.x within the architecture of docker on Ubuntu 16.04. Generally, \"each container should have only one concern\" i.e. there should be single process running per containers. Then all the running containers should be linked with each other. But in the architecture we will be defining in this blog, we will use supervisor as our main process that will run apache server and mysql server together within a single container. Hence we won't need container linking.","og_url":"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/","og_site_name":"Cloudkul","article_published_time":"2017-09-05T15:53:51+00:00","article_modified_time":"2018-07-18T10:23:59+00:00","og_image":[{"width":848,"height":422,"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2017\/09\/download.png","type":"image\/png"}],"author":"Alankrit Srivastava","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/","url":"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/","name":"Magento 2 Docker Installation - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2017-09-05T15:53:51+00:00","dateModified":"2018-07-18T10:23:59+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16"},"description":"Docker is an open-source project that can be integrated with almost all the applications allowing scope of isolation and flexibility. It can be integrated with Magento-2.x as well. Magento is an e-commerce platform written in PHP and based on zend framework available under both open-source and commercial licenses. In this blog, we will run magento2.x within the architecture of docker on Ubuntu 16.04. Generally, \"each container should have only one concern\" i.e. there should be single process running per containers. Then all the running containers should be linked with each other. But in the architecture we will be defining in this blog, we will use supervisor as our main process that will run apache server and mysql server together within a single container. Hence we won't need container linking.","breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/magento-2-docker-installation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Magento 2 Docker Installation"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16","name":"Alankrit Srivastava","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Alankrit Srivastava"},"description":"DevOps Manager at Webkul Software Privated Limited","sameAs":["http:\/\/cloudkul.com"],"url":"https:\/\/cloudkul.com\/blog\/author\/alankrit-srivastava256\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3259"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=3259"}],"version-history":[{"count":52,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3259\/revisions"}],"predecessor-version":[{"id":3304,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3259\/revisions\/3304"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media\/3297"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=3259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=3259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=3259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}