Since Magento 2 requires MySQL 5.6, there are a lot of problems with running Magento 2 in environments such as MAMP and XAMPP with MySQL 5.5 support. If you are going to switch between Magento 1 and 2 projects the issue can turn into a serious headache. In this post, we’ve gathered information about solving the versions problem with the help of Magento 2 virtualization.
UPD (17.08.2015): How to Install Magento 2 with Docker
UPD (24.11.15) PHP 7 Docker Image for Magento 2
The traditional form of virtualization requires such software as VirtualBox on a host OS. A Virtual Machine (VM) with its OS runs inside this software. The other form relies on Linux containers, which are used by Docker. They use Linux OS features like chroot to guarantee a set of processes in one “container”. With this form of virtualization, you don’t have to run a full new OS. Different containers are able to run different versions of software.
Vagrant is a special tool designed to create and configure development environments. Vagrant provides few ways of usage. Firstly, Magento 2 code base is checked out in the file system, whereupon developer gets the ability to edit the code with the help of text editors. Secondly, the web browser is run right on the OS. Thirdly, the code resides in a Vagrant box. The content of the box doesn’t matter much to a developer, as long as the project works. In addition, you can easily share an environment definition with other developers and switch between different Magento projects – different boxes can be defined with different versions of the software. There is also no risk of conflict.
This tool provides a simple way to get your Magento 2 project up and running. Based on a Debian Wheezy box provided via Puppet (VirtualBox is a provider), Magento2 Vagrant Box installs Apache 2 +FastCGI, PHP, PHP-FPM, MySQL and other dependencies. Being a git submodule, Magento 2 repository can be edited from the host machine. It is accessible via shared directories by the guest.
Get a dirty Vagrant image with within minutes. With this Magento 2 tool, you will be able to run MySQL and Apache in a Vagrant box and use other tools on a desktop. vagrant-magento2-apache-base relies on shell scripts to configure things. As a result, readers can poke around and you’ll get problems with learning such technologies as Puppet, Chef, or Ansible. The tool requires the latest version of VirtualBox and its Addons.
How to Install Magento 2 with Docker
Get your ticket to the world of containerization with Docker. In a situation when you are working with several projects, which run on different software versions (for example Magento 1.x on PHP 5.4, Magento 2.x on PHP 5.6, and web host on PHP 5.3) you probably face the problem when system packages don’t exactly match each other. Therefore, you can use Docker to simplify interactions with all your projects. This software solution allows you to package your apps with all their dependencies into standardized units (containers) designed for convenient software development, since they wrap up everything into a complete filesystem with runtime, code, system tools and libraries. As a result, a package runs the same in all possible environments. To get deeper insights into what is Docker, check this page on the official website of the software. I also recommend you to get acquainted with basic aspects of Magento development with Docker here. Additionally, there is an important article on Magento 2 development with Docker on OS Xon Mageinferno. Another important source of useful information related to Magento 2 and Docker is Alan Kent’s blog. For instance he describes how to reduce install headaches with the aid of virtualization here. Hit this link to get Docker on your computer.
PHP 7 Docker Image for Magento 2
The magento2-php image contains PHP configurations for Magento 2. Besides PHP 7, it also includes: