admin/ March 20, 2017/ Docker, Linux, Magento2/ 3 comments




Install Magento2 on Docker Containers.

Now its time to install the Magento 2.x or Magento1.x as you want. You can put your code, import your database and set URL. Enjoy your Magento instance.

Yes, Now we come to docker. Install docker and docker-compose on your Linux machine enjoy your docker instance with few commands. It is really very easy.

How to install Docker ?

There are the few simple steps to install docker and docker-compose.
Step 1-: Install Docker on Ubuntu Machine

Install Docker Compose in Ubuntu Machine.

or

Step 2-: Open your Terminal or ctrl + alt + t ( Shortcut to open terminal )

Step 3-: Git clone the Default Magento2 or copy your code in a html directory.

or

example-:

or

Step 4-: Start the docker container by using below commands.

Notes-: Please stop your apache2 or nginx and mysql server. Because we are using port 80 and 3306 in the give docker-compose.yml.

It will pull the required images first time. It will the images like arvindr226/m2, phpmyadmin/phpmyadmin, mysql.
Then it will create containers as configured in the file docker-compose.yml.

Output-:

Step 5-: Now your docker instance is ready to install or use.
Hit the URL like http://localhost/ or http://serverip/

Step 6-: You need to install composer packages.

You will get the screen like below-:

You need to change the permission of your code directories: app, pub, var like below-:

Step 7-: Now, we will fill the database credentials. According to my docker-compose.yml.
Host-: magento2_db
Username-: magento2
Password-: gotechnies

Follow the wizards fill the proper credentials here.

Step 8-: Install your magento2 instance.

you will get the success page like below-:

How to connect with phpmyadmin or Mysql via terminal ?

To access the phpmyadmin. Here we have linked the container with mysql container.
Simply use the URL with Port 8080.
http://localhost:8080
or
http://serverip:8080/

Terminal Access:

Aditional Step-: Connect the container using ssh.

Use the password-: screencast

Reference URLs-:

https://docs.docker.com/
https://magento.com/
https://github.com/arvindr226/
https://docs.docker.com/compose/

3 Comments

  1. Thanks for sharing.

  2. Thanks a lot for this wonderful tutorial!

    After step 6, I got this error

    “Your requirements could not be resolved to an installable set of packages.

    Problem 1
    – The requested PHP extension ext-soap * is missing from your system. Install or enable PHP’s soap extension.

    How can I solve this issue?

    1. install soap php module using below command.

      $ sudo apt-get install php-soap
      or
      $ sudo apt install php7.0-soap
      or
      $ sudo apt install php7.1-soap

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.