You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -11,19 +11,19 @@ You can use the built-in extension mechanism of Docker to specify [multiple comp
11
11
12
12
1. Create a `docker-compose-dev.yml` file inside your project root directory and add the following content:
13
13
14
-
```yaml
15
-
version: '2'
16
-
services:
17
-
deploy:
14
+
```yaml
15
+
version: '2'
16
+
services:
17
+
deploy:
18
18
environment:
19
-
- ENABLE_SENDMAIL=false
19
+
- ENABLE_SENDMAIL=false
20
20
```
21
21
22
22
1. Pass both configuration files while executing your commands. For example:
23
23
24
-
```bash
25
-
docker-compose -f docker-compose.yml -f docker-compose-dev.yml run deploy bash
26
-
```
24
+
```shell script
25
+
docker-compose -f docker-compose.yml -f docker-compose-dev.yml run deploy bash
26
+
```
27
27
28
28
## Specify Docker build sources
29
29
@@ -32,34 +32,34 @@ by adding the `build:context` configuration to the `docker-compose.override.yml`
32
32
33
33
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.
To update the container configuration and test iteratively, use the `--force-recreate` option to refresh the container build:
44
44
45
-
```bash
46
-
docker-compose up -d --force-recreate --build
47
-
```
45
+
```shell script
46
+
docker-compose up -d --force-recreate --build
47
+
```
48
48
49
49
## Add a new version of existing service
50
50
51
-
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.
51
+
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.
52
52
53
53
{:.procedure}
54
54
To add a new service version using a `Dockerfile`:
55
55
56
-
1. Clone the `{{site.data.var.mcd}}` project to your local environment if necessary.
56
+
1. Clone the `{{site.data.var.mcd-package}}` project to your local environment if necessary.
57
57
58
58
1. On the command line, change to the directory that contains the existing service version configurations.
59
59
60
-
```bash
61
-
cd magento-cloud-docker/images/<service-name>
62
-
```
60
+
```shell script
61
+
cd magento-cloud-docker/images/<service-name>
62
+
```
63
63
64
64
1. Create a directory for the new version.
65
65
@@ -71,8 +71,10 @@ To add a new service version using a `Dockerfile`:
1. Once the build succeeds, test the changes by specifying the [Docker build sources].
77
79
78
80
## Add a new PHP extension
@@ -82,26 +84,147 @@ In addition to built-in extensions, you can add PHP extensions to the PHP contai
82
84
{:.procedure}
83
85
To add a new PHP extension:
84
86
85
-
1. Clone the `{{site.data.var.mcd}}` project to your local environment if necessary.
87
+
1. Clone the `{{site.data.var.mcd-package}}` project to your local environment if necessary.
86
88
87
89
1. On the command line, navigate to the PHP directory.
88
90
89
-
```bash
90
-
cd magento-cloud-docker/src/Compose/Php
91
+
```shell script
92
+
cd magento-cloud-docker/src/Compose/Php
93
+
```
91
94
92
95
1. Open the `ExtensionResolver.php` file, define the required extension inside the `getConfig` method by specifying the extension type and dependency.
93
96
94
-
For instance the following block adds the GNUPG extension:
95
-
96
-
```php?start_inline=1
97
+
We have divided the extensions into three conditional groups:
98
+
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"
99
+
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"
100
+
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"
101
+
102
+
For instance, the following block adds the `bcmath` extension:
For extension types `EXTENSION_TYPE_PECL`\\`EXTENSION_TYPE_PECL`, the following configuration pattern is valid:
122
+
123
+
```php?start_inline=1
124
+
'<extension name>' => [ // this name will be used to identify the extension among other PHP extensions.
125
+
'<php version constraint>' => [ // for which PHP versions this config will apply
126
+
self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE // or self::EXTENSION_TYPE_PECL
127
+
self::EXTENSION_OS_DEPENDENCIES => ['<name dependency package 1>', <name dependency package 2>, ... ] // Linux packages, they will be installed in the order of indication before extantion
128
+
self::EXTENSION_PACKAGE_NAME => '<raw extension name>', // if this parameter exists, then this value will be used when generating the installation command
129
+
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"
130
+
'--option1',
131
+
'--option2',
132
+
...
133
+
]
134
+
],
135
+
'<php version constraint>'=> [
136
+
....
137
+
]
138
+
```
139
+
140
+
Configuration for extensions `gd`, `geoip` and would be good examples:
0 commit comments