From b1d1b600d55652eb12eed79829adcd98ac474baf Mon Sep 17 00:00:00 2001 From: Oleksandr Shmyheliuk Date: Thu, 3 Sep 2020 12:19:09 -0500 Subject: [PATCH 01/21] MCLOUD-6430: Xdebug not working on Magento Cloud Docker 1.1 (#7810) * MCLOUD-6430: Xdebug not working on Magento Cloud Docker 1.1 * Update src/cloud/docker/docker-development-debug.md Co-authored-by: Barny Shergold * Update src/cloud/docker/docker-development-debug.md Co-authored-by: Jeff Matthews Co-authored-by: Barny Shergold Co-authored-by: Jeff Matthews --- src/cloud/docker/docker-development-debug.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-development-debug.md b/src/cloud/docker/docker-development-debug.md index cd5a69e484a..0e112d09796 100644 --- a/src/cloud/docker/docker-development-debug.md +++ b/src/cloud/docker/docker-development-debug.md @@ -23,8 +23,14 @@ If you use Microsoft Windows, take the following steps before continuing: 1. To enable Xdebug for your Docker environment, generate the Docker Compose configuration file in developer mode with the `--with-xdebug` option and any other required options, for example. ```bash - vendor/bin/ece-docker build:compose --mode --sync-engine="mutagen" developer --with-xdebug + vendor/bin/ece-docker build:compose --mode="developer" --sync-engine="mutagen" --with-xdebug ``` + + For Linux systems, you must use the `--set-docker-host` option to add the `host.docker.internal` entry to the `/etc/hosts` file for the `fpm_xdebug` container. + + ```bash + vendor/bin/ece-docker build:compose --mode="developer" --with-xdebug --set-docker-host + ``` This command adds the Xdebug configuration to your `docker-compose.yml` file. From b678eb1a1026aa7ce10a1df080d47c3bf8547015 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Fri, 11 Sep 2020 15:17:40 -0500 Subject: [PATCH 02/21] MCLOUD-6898: Add option to customize port for MailHog (#7860) * MCLOUD-6898: Add option to customize port for MailHog * MCLOUD-6660: Add option to disable MailHog * Update src/cloud/docker/docker-config.md Co-authored-by: Margaret Eker --- src/cloud/docker/docker-config.md | 14 ++++++++++++++ src/cloud/docker/docker-quick-reference.md | 1 + 2 files changed, 15 insertions(+) diff --git a/src/cloud/docker/docker-config.md b/src/cloud/docker/docker-config.md index dd890fc000f..7ad8d503347 100644 --- a/src/cloud/docker/docker-config.md +++ b/src/cloud/docker/docker-config.md @@ -107,6 +107,20 @@ The default {{ site.data.var.mcd-prod }} configuration includes the [MailHog] se When the MailHog service is installed, go to the following URL to open the service and view outgoing emails: `http://magento2.docker:8025` +By default, MailHog listens on port 1025 for SMTP and port 8025 for the frontend dashboard and API. You can change the default ports using the `--mailhog-http-port` and `--mailhog-smtp-port` options. + +```bash +./vendor/bin/ece-docker build:compose --mailhog-smtp-port=1026 --mailhog-http-port=8026 +``` + +After updating the configuration and restarting the Docker environment, you can connect to the MailHog service from `http://magento2.docker:8026`, and use port 1026 for SMTP communication. + +If you do not need the [MailHog] service, use the `--no-mailhog` option to generate the Docker compose configuration: + +```bash +./vendor/bin/ece-docker build:compose --no-mailhog +``` + [php]: https://www.php.net/manual/en/install.php [Composer]: https://getcomposer.org [Docker]: https://www.docker.com/get-started diff --git a/src/cloud/docker/docker-quick-reference.md b/src/cloud/docker/docker-quick-reference.md index 456b2639c16..4e5b4fd0d09 100644 --- a/src/cloud/docker/docker-quick-reference.md +++ b/src/cloud/docker/docker-quick-reference.md @@ -51,6 +51,7 @@ docker-compose -f docker-compose.yml -f docker-compose-custom.yml [-f more-custo | [Mode][] | `--mode`, `-m` | production, developer | [File synchronization engine][] | `--sync-engine` | native (default), docker-sync, mutagen | Specify a custom URL for Magento | `--host`
`--port` +| Specify custom HTTP and SMTP ports for MailHog | `--mailhog-http-port`
`--mailhog-smtp-port` {:.bs-callout-info} See [Service versions] for a list of service configuration options you can add to the `ece-docker build:compose` command to customize the Cloud Docker environment configuration. From caa18a70bafb525936972f67c0dc9876e15b201a Mon Sep 17 00:00:00 2001 From: Oleksandr Shmyheliuk Date: Mon, 21 Sep 2020 12:29:01 -0500 Subject: [PATCH 03/21] MCLOUD-2789: [Cloud Docker] Add custom ES plugins (#7898) * MCLOUD-2789: [Cloud Docker] Add support for adding custom ES plugins from services.yaml file to the docker-compose.yml file. Co-authored-by: Margaret Eker --- src/cloud/docker/docker-containers-service.md | 14 ++++++++++++++ src/cloud/docker/docker-containers.md | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-containers-service.md b/src/cloud/docker/docker-containers-service.md index 8ca8238f69a..5e93eff7838 100755 --- a/src/cloud/docker/docker-containers-service.md +++ b/src/cloud/docker/docker-containers-service.md @@ -75,6 +75,20 @@ See [Important Elasticsearch configuration][] in the Elasticsearch documentation {:.bs-callout-info} If your Cloud project uses Magento version 2.3.5 or earlier with MySQL search, add the `--no-es` option to skip the Elasticsearch container configuration when you generate the Docker Compose configuration file: `ece-docker build:compose --no-es`. +### Elasticsearch plugins + +The `analysis-icu` and `analysis-phonetic` plugins are installed by default and can not be skipped. +If you use Elasticsearch 6.5 and later, the default Elasticsearch plugins configured in `.magento/services.yaml` are installed automatically along with any custom plugins added to the `services.yaml`. When you generate the `docker-compose.yaml` file, custom plugins are added to the `ES_PLUGINS` environment configuration option. + +You can change the list of plugins to install by updating the configuration for the `ES_PLUGINS` variable: + +```yaml +services: + elasticsearch: + environment: + - 'ES_PLUGINS=analysis-stempel analysis-nori' +``` + ### Troubleshooting On some Linux systems, when you launch the Docker environment, the Elasticsearch service fails to start and the following error displays: diff --git a/src/cloud/docker/docker-containers.md b/src/cloud/docker/docker-containers.md index 934b4af18b7..2f775ba318c 100644 --- a/src/cloud/docker/docker-containers.md +++ b/src/cloud/docker/docker-containers.md @@ -43,7 +43,7 @@ The following table shows the options to customize service container configurati | Name | Service | Key & options | Available Versions | Notes | ------------- | ---------- | ---------- | ------------------ |------------------ | [db] | MariaDB or MySQL
| `--db`, `--db-image` (MySQL)
`--expose-db-port`
`--db-increment`
`--db-offset`
`--with-entrypoint`
`--with-mariadb-config`|10.0, 10.1, 10.2
5.6, 5.7 | Use the increment and offset options to customize the [auto-increment settings][Using AUTO_INCREMENT] for replication.

Use the `--with-entrypoint` and `--with-mariadb-config` options to automatically configure database directories in the Docker environment

*Example build commands:*
`ece-docker build:compose --db `
`ece-docker build:compose --db --db-image` -| [elasticsearch] | Elasticsearch | `--es`
`--es-env-var`
`--no-es` | 1.7, 2.4, 5.2, 6.5, 6.8, 7.5, 7.6 | Use the options to specify the Elasticsearch version, customize Elasticsearch configuration options, or to build a Docker environment without Elasticsearch. +| [elasticsearch] | Elasticsearch | `--es`
`--es-env-var`
`--no-es` | 1.7, 2.4, 5.2, 6.5, 6.8, 7.5, 7.6, 7.7 | Use the options to specify the Elasticsearch version, customize Elasticsearch configuration options, or to build a Docker environment without Elasticsearch. | [FPM][fpm-container] | PHP FPM | `--php`
`--with-xdebug` | 7.0, 7.1, 7.2, 7.3, 7.4 | Used for all incoming requests. Optionally, add Xdebug configuration to debug PHP code in the Docker environment. | [node][node-container] | Node | `--node` | 6, 8, 10, 11 | Used gulp or other NPM based commands | [rabbitmq][rabbitmq-container]| RabbitMQ | `--rmq` | 3.5, 3.7, 3.8 | From 1c22fa569f9364bc893634a343c1aef59b0dea3f Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Wed, 23 Sep 2020 20:32:06 -0500 Subject: [PATCH 04/21] [Doc] Adding new PHP extensions #155 --- src/cloud/docker/docker-extend.md | 197 ++++++++++++++++++++++++------ 1 file changed, 160 insertions(+), 37 deletions(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index 67dd31aa8e7..9afd51c86f0 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -11,19 +11,19 @@ You can use the built-in extension mechanism of Docker to specify [multiple comp 1. Create a `docker-compose-dev.yml` file inside your project root directory and add the following content: - ```yaml - version: '2' - services: - deploy: + ```yaml + version: '2' + services: + deploy: environment: - - ENABLE_SENDMAIL=false + - ENABLE_SENDMAIL=false ``` 1. Pass both configuration files while executing your commands. For example: - ```bash - docker-compose -f docker-compose.yml -f docker-compose-dev.yml run deploy bash - ``` + ```shell script + docker-compose -f docker-compose.yml -f docker-compose-dev.yml run deploy bash + ``` ## Specify Docker build sources @@ -32,34 +32,34 @@ by adding the `build:context` configuration to the `docker-compose.override.yml` The following example defines the build context for the Web container. You can use the same technique to build from any of the images in the `vendor/magento/magento-cloud-docker` directory or any other Docker image, including local images that are resourced outside the project. -```yaml -version: '2.1' -services: - web: - build: - context: ./vendor/magento/magento-cloud-docker/images/nginx/1.9/ -``` + ```yaml + version: '2.1' + services: + web: + build: + context: ./vendor/magento/magento-cloud-docker/images/nginx/1.9/ + ``` To update the container configuration and test iteratively, use the `--force-recreate` option to refresh the container build: -```bash -docker-compose up -d --force-recreate --build -``` + ```shell script + docker-compose up -d --force-recreate --build + ``` ## Add a new version of existing service -In {{site.data.var.mcd}} package the available [service versions] are determined by the Docker service images configured in the {{site.data.var.mcd}} `images` directory. You can add a new service version by creating a directory for the version and adding a `Dockerfile` and other files to configure the new version. +In `{{site.data.var.mcd-package}}` package the available [service versions] are determined by the Docker service images configured in the `{{site.data.var.mcd-package}}` `images` directory. You can add a new service version by creating a directory for the version and adding a `Dockerfile` and other files to configure the new version. {:.procedure} To add a new service version using a `Dockerfile`: -1. Clone the `{{site.data.var.mcd}}` project to your local environment if necessary. +1. Clone the `{{site.data.var.mcd-package}}` project to your local environment if necessary. 1. On the command line, change to the directory that contains the existing service version configurations. - ```bash - cd magento-cloud-docker/images/ - ``` + ```shell script + cd magento-cloud-docker/images/ + ``` 1. Create a directory for the new version. @@ -71,8 +71,10 @@ To add a new service version using a `Dockerfile`: 1. Run the following command to build the image. - `docker build -t test/:` - + ```shell script + docker build -t test/: + ``` + 1. Once the build succeeds, test the changes by specifying the [Docker build sources]. ## Add a new PHP extension @@ -82,26 +84,147 @@ In addition to built-in extensions, you can add PHP extensions to the PHP contai {:.procedure} To add a new PHP extension: -1. Clone the `{{site.data.var.mcd}}` project to your local environment if necessary. +1. Clone the `{{site.data.var.mcd-package}}` project to your local environment if necessary. 1. On the command line, navigate to the PHP directory. - ```bash - cd magento-cloud-docker/src/Compose/Php + ```shell script + cd magento-cloud-docker/src/Compose/Php + ``` 1. Open the `ExtensionResolver.php` file, define the required extension inside the `getConfig` method by specifying the extension type and dependency. - For instance the following block adds the GNUPG extension: - - ```php?start_inline=1 + We have divided the extensions into three conditional groups: + 1. `EXTENSION_TYPE_CORE` - Extension that exists in the `docker-php-source` More details [https://hub.docker.com/_/php][PHP, Docker Official Images], the part "How to install more PHP extensions" + 1. `EXTENSION_TYPE_PECL` - Extensions that can be installed from [https://pecl.php.net/][PECL]. More details [https://hub.docker.com/_/php][PHP, Docker Official Images], the part "PECL extensions" + 1. `EXTENSION_TYPE_INSTALLATION_SCRIPT` - For extensions that can be installed by running a number commands. More details [https://hub.docker.com/_/php][PHP, Docker Official Images], part "Other extensions" + + For instance, the following block adds the `bcmath` extension: + + ```php?start_inline=1 + 'bcmath' => [ + '>=7.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], + ], + ``` + + In this case `bcmath` extensions will be install from `docker-php-source` for all `PHP` versions starting from `7.0`. + + In case of installing an extension from `PECL` which has a dependency on a specific package: + ```php?start_inline=1 'gnupg' => [ '>=7.0' => [ - self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, - self::EXTENSION_OS_DEPENDENCIES => ['libgpgme11-dev'], - ],], - ``` - - The extension type can be either CORE or PECL, which are defined as `EXTENSION_TYPE_PECL` or `EXTENSION_TYPE_CORE` respectively. + self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, + self::EXTENSION_OS_DEPENDENCIES => ['libgpgme11-dev'], + ], + ], + ``` + For extension types `EXTENSION_TYPE_PECL`\\`EXTENSION_TYPE_PECL`, the following configuration pattern is valid: + + ```php?start_inline=1 + '' => [ // this name will be used to identify the extension among other PHP extensions. + '' => [ // for which PHP versions this config will apply + self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE // or self::EXTENSION_TYPE_PECL + self::EXTENSION_OS_DEPENDENCIES => ['', , ... ] // Linux packages, they will be installed in the order of indication before extantion + self::EXTENSION_PACKAGE_NAME => '', // if this parameter exists, then this value will be used when generating the installation command + self::EXTENSION_CONFIGURE_OPTIONS => [ // options to be applied when configuring a PHP extension using the command `docker-php-ext-configure`. More details [https://hub.docker.com/_/php][PHP, Docker Official Images], part "PHP Core Extensions" + '--option1', + '--option2', + ... + ] + ], + '' => [ + .... + ] + ``` + + Configuration for extensions `gd`, `geoip` and would be good examples: + + ```php?start_inline=1 + 'gd' => [ + '>=7.0 <=7.3' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE, + self::EXTENSION_OS_DEPENDENCIES => ['libjpeg62-turbo-dev', 'libpng-dev', 'libfreetype6-dev'], + self::EXTENSION_CONFIGURE_OPTIONS => [ + '--with-freetype-dir=/usr/include/', + '--with-jpeg-dir=/usr/include/' + ], + ], + '>=7.4' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE, + self::EXTENSION_OS_DEPENDENCIES => ['libjpeg62-turbo-dev', 'libpng-dev', 'libfreetype6-dev'], + self::EXTENSION_CONFIGURE_OPTIONS => [ + '--with-freetype=/usr/include/', + '--with-jpeg=/usr/include/' + ], + ], + + ], + 'geoip' => [ + '>=7.0' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, + self::EXTENSION_OS_DEPENDENCIES => ['libgeoip-dev', 'wget'], + self::EXTENSION_PACKAGE_NAME => 'geoip-1.1.1', + ], + ], + ``` + + If the installation requires the execution of special commands, then use the type `EXTENSION_TYPE_INSTALLATION_SCRIPT`. + The template for this type: + + ```php?start_inline=1 + 'extension name' => [ + 'php version constraint' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, + self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH + + BASH + ], + ``` + + Usage example: + ```php?start_inline=1 + 'ioncube' => [ + '>=7.0 <=7.3' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, + self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH + cd /tmp + curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + tar zxvf ioncube_loaders_lin_x86-64.tar.gz + export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") + export PHP_EXT_DIR=$(php-config --extension-dir) + cp "./ioncube/ioncube_loader_lin_\${PHP_VERSION}.so" "\${PHP_EXT_DIR}/ioncube.so" + rm -rf ./ioncube + rm ioncube_loaders_lin_x86-64.tar.gz + BASH + ], + ``` +1. If you want the extension to be enabled by default, then add it to the array `DEFAULT_PHP_EXTENSIONS` + +```php?start_inline=1 + /** + * Extensions which should be installed by default + */ + public const DEFAULT_PHP_EXTENSIONS = [ + 'bcmath', + 'bz2', + 'calendar', + 'exif', + 'gd', + 'gettext', + 'intl', + 'mysqli', + 'pcntl', + 'pdo_mysql', + 'soap', + 'sockets', + 'sysvmsg', + 'sysvsem', + 'sysvshm', + 'opcache', + 'zip', + ]; +``` +Otherwise, to enable, you will need to specify the name of the extension in the file `magento.app.yaml` of your projects and restart docker container. 1. Add any required `.ini` files to the PHP FPM container configuration. From 10aff0d51365fcf617f17e96cc4b0b9cc8d7226b Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:36:26 -0500 Subject: [PATCH 05/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Barny Shergold --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index 9afd51c86f0..9ab0f188481 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -95,7 +95,7 @@ To add a new PHP extension: 1. Open the `ExtensionResolver.php` file, define the required extension inside the `getConfig` method by specifying the extension type and dependency. We have divided the extensions into three conditional groups: - 1. `EXTENSION_TYPE_CORE` - Extension that exists in the `docker-php-source` More details [https://hub.docker.com/_/php][PHP, Docker Official Images], the part "How to install more PHP extensions" + 1. `EXTENSION_TYPE_CORE` - Extension that exists in the `docker-php-source`. More details can be found at [https://hub.docker.com/_/php][PHP, Docker Official Images], in the "How to install more PHP extensions" section. 1. `EXTENSION_TYPE_PECL` - Extensions that can be installed from [https://pecl.php.net/][PECL]. More details [https://hub.docker.com/_/php][PHP, Docker Official Images], the part "PECL extensions" 1. `EXTENSION_TYPE_INSTALLATION_SCRIPT` - For extensions that can be installed by running a number commands. More details [https://hub.docker.com/_/php][PHP, Docker Official Images], part "Other extensions" From 22249c5d98ec4ec2dc8af677e793b651c7764323 Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:37:02 -0500 Subject: [PATCH 06/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Barny Shergold --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index 9ab0f188481..492ab0a5306 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -97,7 +97,7 @@ To add a new PHP extension: We have divided the extensions into three conditional groups: 1. `EXTENSION_TYPE_CORE` - Extension that exists in the `docker-php-source`. More details can be found at [https://hub.docker.com/_/php][PHP, Docker Official Images], in the "How to install more PHP extensions" section. 1. `EXTENSION_TYPE_PECL` - Extensions that can be installed from [https://pecl.php.net/][PECL]. More details [https://hub.docker.com/_/php][PHP, Docker Official Images], the part "PECL extensions" - 1. `EXTENSION_TYPE_INSTALLATION_SCRIPT` - For extensions that can be installed by running a number commands. More details [https://hub.docker.com/_/php][PHP, Docker Official Images], part "Other extensions" + 1. `EXTENSION_TYPE_INSTALLATION_SCRIPT` - For extensions that can be installed by running a number commands. More details can be found at [https://hub.docker.com/_/php][PHP, Docker Official Images], in the "Other extensions" section. For instance, the following block adds the `bcmath` extension: From a3e46118661673fed527ae234253bf3cdbb2f44c Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:37:36 -0500 Subject: [PATCH 07/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Barny Shergold --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index 492ab0a5306..c3be46216df 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -107,7 +107,7 @@ To add a new PHP extension: ], ``` - In this case `bcmath` extensions will be install from `docker-php-source` for all `PHP` versions starting from `7.0`. + In this case, the `bcmath` extension installs from `docker-php-source` for all `PHP` versions starting from `7.0`. In case of installing an extension from `PECL` which has a dependency on a specific package: ```php?start_inline=1 From 9146046a842181ca651476a06abd6bc10ac38892 Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:40:25 -0500 Subject: [PATCH 08/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Barny Shergold --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index c3be46216df..bd9012ee5b1 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -126,7 +126,7 @@ To add a new PHP extension: self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE // or self::EXTENSION_TYPE_PECL self::EXTENSION_OS_DEPENDENCIES => ['', , ... ] // Linux packages, they will be installed in the order of indication before extantion self::EXTENSION_PACKAGE_NAME => '', // if this parameter exists, then this value will be used when generating the installation command - self::EXTENSION_CONFIGURE_OPTIONS => [ // options to be applied when configuring a PHP extension using the command `docker-php-ext-configure`. More details [https://hub.docker.com/_/php][PHP, Docker Official Images], part "PHP Core Extensions" + self::EXTENSION_CONFIGURE_OPTIONS => [ // options to be applied when configuring a PHP extension using the command `docker-php-ext-configure`. See the the "PHP Core Extensions" section in the [https://hub.docker.com/_/php][PHP, Docker Official Images] documentation. '--option1', '--option2', ... From 85ea11fdecf24444433da514e4b924144a4b2298 Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:40:35 -0500 Subject: [PATCH 09/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Barny Shergold --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index bd9012ee5b1..9e1886dd20b 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -137,7 +137,7 @@ To add a new PHP extension: ] ``` - Configuration for extensions `gd`, `geoip` and would be good examples: + Configuration for extensions `gd`, `geoip` are good examples: ```php?start_inline=1 'gd' => [ From f6191d76e530005e81be8496a83b6383d6ded5c5 Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:40:49 -0500 Subject: [PATCH 10/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Barny Shergold --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index 9e1886dd20b..e900b782689 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -224,7 +224,7 @@ To add a new PHP extension: 'zip', ]; ``` -Otherwise, to enable, you will need to specify the name of the extension in the file `magento.app.yaml` of your projects and restart docker container. +Otherwise, to enable an extension, you must specify the name of the extension in the `.magento.app.yaml` for your Cloud project, regenerate the Docker compose configuration file, and restart the Docker container. 1. Add any required `.ini` files to the PHP FPM container configuration. From cd61ea38feb08d126276c5456909b151544def6e Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:40:59 -0500 Subject: [PATCH 11/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Margaret Eker --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index e900b782689..9853ee1e1ce 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -21,7 +21,7 @@ You can use the built-in extension mechanism of Docker to specify [multiple comp 1. Pass both configuration files while executing your commands. For example: - ```shell script + ```bash docker-compose -f docker-compose.yml -f docker-compose-dev.yml run deploy bash ``` From 1149bc70d1b21f12b093e70dd7aa2a486d15f192 Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:41:08 -0500 Subject: [PATCH 12/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Margaret Eker --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index 9853ee1e1ce..f33cff87dfe 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -42,7 +42,7 @@ The following example defines the build context for the Web container. You can u To update the container configuration and test iteratively, use the `--force-recreate` option to refresh the container build: - ```shell script + ```bash docker-compose up -d --force-recreate --build ``` From b25f5f5702928a6dbfd87e2f7329d3e5805ef08a Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:41:16 -0500 Subject: [PATCH 13/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Margaret Eker --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index f33cff87dfe..d5a95fb966f 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -48,7 +48,7 @@ To update the container configuration and test iteratively, use the `--force-rec ## Add a new version of existing service -In `{{site.data.var.mcd-package}}` package the available [service versions] are determined by the Docker service images configured in the `{{site.data.var.mcd-package}}` `images` directory. You can add a new service version by creating a directory for the version and adding a `Dockerfile` and other files to configure the new version. +In the `{{site.data.var.mcd-package}}` package the available [service versions] are determined by the Docker service images configured in the `{{site.data.var.mcd-package}}` `images` directory. You can add a new service version by creating a directory for the version and adding a `Dockerfile` and other files to configure the new version. {:.procedure} To add a new service version using a `Dockerfile`: From 8e41eb13005ef0f15983dd9d694a8c9a59d55d3a Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:41:23 -0500 Subject: [PATCH 14/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Margaret Eker --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index d5a95fb966f..994bb7a5cae 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -71,7 +71,7 @@ To add a new service version using a `Dockerfile`: 1. Run the following command to build the image. - ```shell script + ```bash docker build -t test/: ``` From b371890060792407b452ae42ce1690f32f70b993 Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:41:36 -0500 Subject: [PATCH 15/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Margaret Eker --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index 994bb7a5cae..86f6398cb3e 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -57,7 +57,7 @@ To add a new service version using a `Dockerfile`: 1. On the command line, change to the directory that contains the existing service version configurations. - ```shell script + ```bash cd magento-cloud-docker/images/ ``` From d6d1b1ac73c1ba0148e9758ba624247e60611b10 Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:41:44 -0500 Subject: [PATCH 16/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Margaret Eker --- src/cloud/docker/docker-extend.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index 86f6398cb3e..f6b8224de8e 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -92,7 +92,11 @@ To add a new PHP extension: cd magento-cloud-docker/src/Compose/Php ``` -1. Open the `ExtensionResolver.php` file, define the required extension inside the `getConfig` method by specifying the extension type and dependency. +1. Add one or more extensions: to the `ExtensionResolver.php` file: + + - Open the `ExtensionResolver.php` file for editing. + + - Define the required extension in the `getConfig` method by specifying the extension type and dependency. We have divided the extensions into three conditional groups: 1. `EXTENSION_TYPE_CORE` - Extension that exists in the `docker-php-source`. More details can be found at [https://hub.docker.com/_/php][PHP, Docker Official Images], in the "How to install more PHP extensions" section. From a13bbecbc99ccb86d16d8d9c2f6e312391f6d820 Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:42:15 -0500 Subject: [PATCH 17/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Margaret Eker --- src/cloud/docker/docker-extend.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index f6b8224de8e..47bac572be7 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -125,10 +125,10 @@ To add a new PHP extension: For extension types `EXTENSION_TYPE_PECL`\\`EXTENSION_TYPE_PECL`, the following configuration pattern is valid: ```php?start_inline=1 - '' => [ // this name will be used to identify the extension among other PHP extensions. - '' => [ // for which PHP versions this config will apply + '' => [ // Name to identify the extension among other PHP extensions. + '' => [ // Specifies which PHP versions this configuration applies to self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE // or self::EXTENSION_TYPE_PECL - self::EXTENSION_OS_DEPENDENCIES => ['', , ... ] // Linux packages, they will be installed in the order of indication before extantion + self::EXTENSION_OS_DEPENDENCIES => ['', , ... ] // Specifies Linux package dependencies. These packages install in the order listed before installing the extension. self::EXTENSION_PACKAGE_NAME => '', // if this parameter exists, then this value will be used when generating the installation command self::EXTENSION_CONFIGURE_OPTIONS => [ // options to be applied when configuring a PHP extension using the command `docker-php-ext-configure`. See the the "PHP Core Extensions" section in the [https://hub.docker.com/_/php][PHP, Docker Official Images] documentation. '--option1', From dc8c1af069746e4d9ff77bb0fa4fc4009609b2a3 Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:42:25 -0500 Subject: [PATCH 18/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Margaret Eker --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index 47bac572be7..6ef16b99a34 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -172,7 +172,7 @@ To add a new PHP extension: ], ``` - If the installation requires the execution of special commands, then use the type `EXTENSION_TYPE_INSTALLATION_SCRIPT`. + If the installation requires multi-step command processing, use the `EXTENSION_TYPE_INSTALLATION_SCRIPT` type. The template for this type: ```php?start_inline=1 From 43063cb8bd8cddfe0af9e6007e443ce92f094a85 Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:42:37 -0500 Subject: [PATCH 19/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Barny Shergold --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index 6ef16b99a34..7df430f23d0 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -100,7 +100,7 @@ To add a new PHP extension: We have divided the extensions into three conditional groups: 1. `EXTENSION_TYPE_CORE` - Extension that exists in the `docker-php-source`. More details can be found at [https://hub.docker.com/_/php][PHP, Docker Official Images], in the "How to install more PHP extensions" section. - 1. `EXTENSION_TYPE_PECL` - Extensions that can be installed from [https://pecl.php.net/][PECL]. More details [https://hub.docker.com/_/php][PHP, Docker Official Images], the part "PECL extensions" + 1. `EXTENSION_TYPE_PECL` - Extensions that can be installed from [https://pecl.php.net/][PECL]. More details can be found at [https://hub.docker.com/_/php][PHP, Docker Official Images], in the "PECL extensions" section. 1. `EXTENSION_TYPE_INSTALLATION_SCRIPT` - For extensions that can be installed by running a number commands. More details can be found at [https://hub.docker.com/_/php][PHP, Docker Official Images], in the "Other extensions" section. For instance, the following block adds the `bcmath` extension: From 849202c4290edc64607cf6604e150eb1be403fe9 Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 12:42:45 -0500 Subject: [PATCH 20/21] Update src/cloud/docker/docker-extend.md Co-authored-by: Barny Shergold --- src/cloud/docker/docker-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/docker/docker-extend.md b/src/cloud/docker/docker-extend.md index 7df430f23d0..10d0b0a0ea3 100644 --- a/src/cloud/docker/docker-extend.md +++ b/src/cloud/docker/docker-extend.md @@ -113,7 +113,7 @@ To add a new PHP extension: In this case, the `bcmath` extension installs from `docker-php-source` for all `PHP` versions starting from `7.0`. - In case of installing an extension from `PECL` which has a dependency on a specific package: + In the case of installing an extension from `PECL` which has a dependency on a specific package: ```php?start_inline=1 'gnupg' => [ '>=7.0' => [ From 52e99dd460522aaae2dfa85f2f5e2594c1d2b14a Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Oct 2020 13:12:21 -0500 Subject: [PATCH 21/21] [Doc] Adding new PHP extensions #155 --- src/cloud/docker/docker-config.md | 14 -------------- src/cloud/docker/docker-containers-service.md | 14 -------------- src/cloud/docker/docker-containers.md | 2 +- src/cloud/docker/docker-development-debug.md | 6 ------ src/cloud/docker/docker-quick-reference.md | 1 - 5 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/cloud/docker/docker-config.md b/src/cloud/docker/docker-config.md index 5048f2b256c..af9562c5d66 100644 --- a/src/cloud/docker/docker-config.md +++ b/src/cloud/docker/docker-config.md @@ -134,20 +134,6 @@ The default {{ site.data.var.mcd-prod }} configuration includes the [MailHog] se When the MailHog service is installed, go to the following URL to open the service and view outgoing emails: `http://magento2.docker:8025` -By default, MailHog listens on port 1025 for SMTP and port 8025 for the frontend dashboard and API. You can change the default ports using the `--mailhog-http-port` and `--mailhog-smtp-port` options. - -```bash -./vendor/bin/ece-docker build:compose --mailhog-smtp-port=1026 --mailhog-http-port=8026 -``` - -After updating the configuration and restarting the Docker environment, you can connect to the MailHog service from `http://magento2.docker:8026`, and use port 1026 for SMTP communication. - -If you do not need the [MailHog] service, use the `--no-mailhog` option to generate the Docker compose configuration: - -```bash -./vendor/bin/ece-docker build:compose --no-mailhog -``` - [php]: https://www.php.net/manual/en/install.php [Composer]: https://getcomposer.org [Docker]: https://www.docker.com/get-started diff --git a/src/cloud/docker/docker-containers-service.md b/src/cloud/docker/docker-containers-service.md index 5e93eff7838..8ca8238f69a 100755 --- a/src/cloud/docker/docker-containers-service.md +++ b/src/cloud/docker/docker-containers-service.md @@ -75,20 +75,6 @@ See [Important Elasticsearch configuration][] in the Elasticsearch documentation {:.bs-callout-info} If your Cloud project uses Magento version 2.3.5 or earlier with MySQL search, add the `--no-es` option to skip the Elasticsearch container configuration when you generate the Docker Compose configuration file: `ece-docker build:compose --no-es`. -### Elasticsearch plugins - -The `analysis-icu` and `analysis-phonetic` plugins are installed by default and can not be skipped. -If you use Elasticsearch 6.5 and later, the default Elasticsearch plugins configured in `.magento/services.yaml` are installed automatically along with any custom plugins added to the `services.yaml`. When you generate the `docker-compose.yaml` file, custom plugins are added to the `ES_PLUGINS` environment configuration option. - -You can change the list of plugins to install by updating the configuration for the `ES_PLUGINS` variable: - -```yaml -services: - elasticsearch: - environment: - - 'ES_PLUGINS=analysis-stempel analysis-nori' -``` - ### Troubleshooting On some Linux systems, when you launch the Docker environment, the Elasticsearch service fails to start and the following error displays: diff --git a/src/cloud/docker/docker-containers.md b/src/cloud/docker/docker-containers.md index 2f775ba318c..934b4af18b7 100644 --- a/src/cloud/docker/docker-containers.md +++ b/src/cloud/docker/docker-containers.md @@ -43,7 +43,7 @@ The following table shows the options to customize service container configurati | Name | Service | Key & options | Available Versions | Notes | ------------- | ---------- | ---------- | ------------------ |------------------ | [db] | MariaDB or MySQL
| `--db`, `--db-image` (MySQL)
`--expose-db-port`
`--db-increment`
`--db-offset`
`--with-entrypoint`
`--with-mariadb-config`|10.0, 10.1, 10.2
5.6, 5.7 | Use the increment and offset options to customize the [auto-increment settings][Using AUTO_INCREMENT] for replication.

Use the `--with-entrypoint` and `--with-mariadb-config` options to automatically configure database directories in the Docker environment

*Example build commands:*
`ece-docker build:compose --db `
`ece-docker build:compose --db --db-image` -| [elasticsearch] | Elasticsearch | `--es`
`--es-env-var`
`--no-es` | 1.7, 2.4, 5.2, 6.5, 6.8, 7.5, 7.6, 7.7 | Use the options to specify the Elasticsearch version, customize Elasticsearch configuration options, or to build a Docker environment without Elasticsearch. +| [elasticsearch] | Elasticsearch | `--es`
`--es-env-var`
`--no-es` | 1.7, 2.4, 5.2, 6.5, 6.8, 7.5, 7.6 | Use the options to specify the Elasticsearch version, customize Elasticsearch configuration options, or to build a Docker environment without Elasticsearch. | [FPM][fpm-container] | PHP FPM | `--php`
`--with-xdebug` | 7.0, 7.1, 7.2, 7.3, 7.4 | Used for all incoming requests. Optionally, add Xdebug configuration to debug PHP code in the Docker environment. | [node][node-container] | Node | `--node` | 6, 8, 10, 11 | Used gulp or other NPM based commands | [rabbitmq][rabbitmq-container]| RabbitMQ | `--rmq` | 3.5, 3.7, 3.8 | diff --git a/src/cloud/docker/docker-development-debug.md b/src/cloud/docker/docker-development-debug.md index 75e9c39ead5..348e1e359d9 100644 --- a/src/cloud/docker/docker-development-debug.md +++ b/src/cloud/docker/docker-development-debug.md @@ -25,12 +25,6 @@ If you use Microsoft Windows, take the following steps before continuing: ```bash vendor/bin/ece-docker build:compose --mode="developer" --sync-engine="mutagen" --with-xdebug ``` - - For Linux systems, you must use the `--set-docker-host` option to add the `host.docker.internal` entry to the `/etc/hosts` file for the `fpm_xdebug` container. - - ```bash - vendor/bin/ece-docker build:compose --mode="developer" --with-xdebug --set-docker-host - ``` This command adds the Xdebug configuration to your `docker-compose.yml` file. diff --git a/src/cloud/docker/docker-quick-reference.md b/src/cloud/docker/docker-quick-reference.md index 4e5b4fd0d09..456b2639c16 100644 --- a/src/cloud/docker/docker-quick-reference.md +++ b/src/cloud/docker/docker-quick-reference.md @@ -51,7 +51,6 @@ docker-compose -f docker-compose.yml -f docker-compose-custom.yml [-f more-custo | [Mode][] | `--mode`, `-m` | production, developer | [File synchronization engine][] | `--sync-engine` | native (default), docker-sync, mutagen | Specify a custom URL for Magento | `--host`
`--port` -| Specify custom HTTP and SMTP ports for MailHog | `--mailhog-http-port`
`--mailhog-smtp-port` {:.bs-callout-info} See [Service versions] for a list of service configuration options you can add to the `ece-docker build:compose` command to customize the Cloud Docker environment configuration.