What Is New in Version 2
magento-scriptsversion 2.0.0 has been in development since mid-July 2022 and the main goal of its creation was to eliminate dependency on system packages.
That was the reason why
magento-scriptsstopped working on Ubuntu 22.04 (because of the upgraded OpenSSL version) and in general, required a super-complex system for installing and validating required packages on all systems, plus a complex and time-consuming PHP build time to process. And it was practically impossible to isolate CMA instances from one another without the need to compile PHP for each instance. But it was fast in the end because PHP was running on the host system and did not experience performance losses on file operations or processing power in the VM on macOS and other systems.
Version 2 introduces a PHP container into the setup. With this move, we don't need a complex dependency installation and validation system, nor a complex PHP build system anymore.
PHP Image Infrastructure
Those are the steps for PHP images:
- 1.Alpine Linux image is used as a base for images with PHP. Only in this step PHP is actually compiled. No additional extensions are installed.
- 2.PHP image is used as a base for images with PHP extensions for Magento. In this step PHP extensions for Magento 2.3 or Magento 2.4 are installed.
- 3.PHP image with Magento extensions is used as a base for Project Image that is built on the user system. This image installs the Composer version corresponding to Magento requirements and additional extensions for PHP defined in the configuration file by a user.
Steps 2-3 are repeated for images with XDebug that are based on PHP images with XDebug.
It is necessary to have 2 images with XDebug and without to be able to switch between them instantly when running the start command with debug option.
We observed a very strange behaviour with MySQL 5.7 on Linux systems with Docker Engine. When started container will consume all resources given to the system and basically freeze the computer.
In addition to that, we already have MariaDB in our setup for macOS on ARM64 chips (M1) because MariaDB actually has ARM64 images that can run on those systems.
Since existing setups are still running on MySQL we developed a migration script that will run if it detects that you have MySQL volume in your project. The process is automated, the user just needs to press ENTER a few times to get a new working setup.
Maildev is also added to the setup so you will be able to catch emails during development.