webkul/magento2.2.1

By webkul

Updated about 7 years ago

Follow the blog: https://cloudkul.com/blog/launch-your-magento-2-2-store-within-minutes/

Image

140

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.1 store within minutes using Docker containers.

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.

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

docker pull webkul/magento2.2.1

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

docker run -ti --name=your_container_name -p host_port:80 webkul/magento2.2.1

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

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

IMPORTANT:- Now take a note that you have been asked 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:

docker ps

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:

docker stop container_id

To launch another container with same port or different port. Try to explore more and more within Docker containers. If you have issues, share your enthusiasm with us.

Docker Pull Command

docker pull webkul/magento2.2.1