9K Views

Launch your Magento 2.2 Store Within Minutes

Up until now, the Docker architectures for Magento 2 we have been discussing, were concerned with production servers environments. Goes by its name, production servers are architectured for long term use and are highly complexed. But what if we want temporary mortal servers? Such as we often need Test/Dev servers to replicate the production environment to test our applications. Also, sometimes we have to test different environments for our applications by changing one or two variables. So, bottom line is that we do not want to indulge in time taking process of server setups and their termination. Here comes our today’s topic in play. In this blog, we will discuss to launch Magento 2.2 store within minutes using Docker containers.

 

Docker Container Comes to Rescue:

 

We created a Docker Image with Apache2 server, Mysql Server 5.7 and PHP 7.0 for Magento 2.2.1 having Ubuntu 16.04 as OS. For our instant server setup, we will use this image to run containers on our host. To begin with, please make sure that you have Docker install on your Ubuntu 16.04. If not please follow, docker installation steps.

Once our host is ready to use docker, pull the image as

It will take some time to download all the layers of the image. Once done, run the docker container as,

Assign unique name of the container (your_container_name) and allocate a free port to it host_port).

 

IMPORTANT:- Please do not use ‘-d’ (-d for detached mode) parameter while running the above command as it will create conflicts with our flow. We will detach our container later.

 

Now as you launch the container, you will enter the docker container shell and you will see prompts for user inputs for:

 

  • Website Domain/IP address
  • Your MySQL Password
  • Your Admin password

 

After your user inputs, your screen will be something like this:

 

 

You will see your admin URL and admin panel login user.

 

IMPORTANT:- Also, remember to press “ctrl p ctrl q” before exiting the container. It is done to put container in detached mode. It is highly recommended to press ctrl p ctrl q, otherwise container will be stopped.

 

After entering the detached mode, you will be exited from container. Check the running docker container status as:

You will see all the running containers. Now check your Magento 2.2.1 store by browsing to your domain.

Now to stop and terminate the container, run command:

To launch another container with same port or different port. Furthermore, you can check the Docker image on docker hub https://hub.docker.com/r/webkul/magento2.2.1/.

Try to explore more and more within Docker containers. If you have issues, share your enthusiasm with us.

 

. . .

Comment

Add Your Comment

Be the first to comment.

css.php