Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit a277458

Browse files
meker12maeker12
andauthored
Updates for Cloud Docker 1.2.0 release (#8198)
* Updated Docker Quick reference - Addedd new options to the magento-docker CLI - Added listing that shows all available options for ece-docker build:compose command - Added intro to Docker Compose section * MCLOUD-7809 Added instructions for building custom docker-compose.yaml file * Improved instructions for using the init-docker.sh installation script * Updates for Magento Cloud Docker 1.2.0 release notes Co-authored-by: maeker12 <{ID}+{username}@users.noreply.github.com>
1 parent dbc2cb3 commit a277458

10 files changed

+282
-21
lines changed

src/_data/toc/cloud-guide.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,15 @@ pages:
215215
versionless: true
216216

217217
- label: Launch Docker
218-
children:
219-
- label: Developer mode
220-
url: /cloud/docker/docker-mode-developer.html
221-
versionless: true
222218

219+
children:
223220
- label: Production mode
224221
url: /cloud/docker/docker-mode-production.html
225222
versionless: true
223+
224+
- label: Developer mode
225+
url: /cloud/docker/docker-mode-developer.html
226+
versionless: true
226227

227228
- label: Functional Testing
228229
children:

src/_data/var.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ mbi: Magento Business Intelligence
2121
# Cloud product name variables
2222

2323
ece: Magento Commerce Cloud
24-
ece-release-date: August 5, 2020
24+
ece-release-date: November 9, 2020
2525
csuite: Magento Commerce Cloud Suite
2626
ct: ece-tools
2727
ct-repo: magento/ece-tools
@@ -31,7 +31,7 @@ mcp-package: magento/magento-cloud-patches
3131
mcp-release: 1.0.8
3232
mcd-package: magento/magento-cloud-docker
3333
mcd-prod: Magento Cloud Docker
34-
mcd-release: 1.1.2
34+
mcd-release: 1.2.0
3535
mcc-prod: Magento Cloud Components
3636
mcc-package: magento/magento-cloud-components
3737
mcc-release: 1.0.7

src/cloud/docker/docker-config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ By default, MailHog listens on port 1025 for SMTP and port 8025 for the frontend
142142

143143
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.
144144

145-
If you do not need the [MailHog] service, use the `--no-mailhog` option to generate the Docker compose configuration:
145+
If you do not need the [MailHog] service, use the `--no-mailhog` option to generate the Docker compose configuration:
146146

147147
```bash
148148
./vendor/bin/ece-docker build:compose --no-mailhog

src/cloud/docker/docker-containers-service.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ You can change the list of plugins to install by updating the configuration for
8686
services:
8787
elasticsearch:
8888
environment:
89-
- 'ES_PLUGINS=analysis-stempel analysis-nori'
90-
```
89+
- 'ES_PLUGINS=analysis-stempel analysis-nori'
90+
```
9191

9292
### Troubleshooting
9393

src/cloud/docker/docker-containers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The following table shows the options to customize service container configurati
5454
| [varnish][varnish-container] | Varnish | `--no-varnish` | 4, 6.2 | Varnish is provisioned by default. Use the `--no-varnish` option to skip Varnish service installation
5555
| [web][web-container] | NGINX | `--nginx` | 1.9, latest |
5656

57-
Use the following command to view the available options for the `ece-docker build:compose` command:
57+
Use the following command to view all available options for the `ece-docker build:compose` command:
5858

5959
```bash
6060
./vendor/bin/ece-docker build:compose --help

src/cloud/docker/docker-development-debug.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ If you use Microsoft Windows, take the following steps before continuing:
2525
```bash
2626
vendor/bin/ece-docker build:compose --mode="developer" --sync-engine="mutagen" --with-xdebug
2727
```
28-
28+
2929
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.
30-
30+
3131
```bash
3232
vendor/bin/ece-docker build:compose --mode="developer" --with-xdebug --set-docker-host
3333
```

src/cloud/docker/docker-mode-developer.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ To launch the Docker environment in developer mode:
2626
1. Install the template dependencies, and add the default hostname to your `/etc/hosts` file.
2727

2828
```bash
29-
curl https://raw.githubusercontent.com/magento/magento-cloud-docker/1.1.0/bin/init-docker.sh | bash
29+
curl https://raw.githubusercontent.com/magento/magento-cloud-docker/<magento-cloud-docker-package-version>/bin/init-docker.sh | bash
3030
```
3131

32-
If required, you can add options to the `init-docker.sh` initialization script to customize your Docker environment. Run the following command to see the available options:
32+
For `<package-version>`, use the [latest release of the {{site.data.var.mcd-package}}].
33+
34+
You can customize the options for the `init-docker.sh` initialization script your Docker environment. For example, you can specify the PHP version (default is 7.2) and the [Docker image version] (default 1.1). We recommend using the latest version of the Magento Cloud Docker images. Run the following command to see the available options:
3335

3436
```bash
35-
curl https://raw.githubusercontent.com/magento/magento-cloud-docker/1.1.0/bin/init-docker.sh | bash -s -- --help
37+
curl https://raw.githubusercontent.com/magento/magento-cloud-docker/<magento-cloud-package-version>/bin/init-docker.sh | bash -s -- --help
3638
```
3739

3840
1. On macOS or Windows hosts, install the selected file synchronization tool:
@@ -129,11 +131,15 @@ To launch the Docker environment in developer mode:
129131

130132
- `https://magento2.docker`
131133

132-
[Synchronizing data in Docker]: {{site.baseurl}}/cloud/docker/docker-syncing-data.html
134+
<!--Link definitioons-->
135+
133136
[cloud-repo]: https://github.com/magento/magento-cloud
137+
[Docker image version]: https://hub.docker.com/r/magento/magento-cloud-docker-php/tags
138+
[dsync-install]: https://docker-sync.readthedocs.io/en/latest/getting-started/installation.html
139+
[latest release of the {{site.data.var.mcd-package}}]: https://github.com/magento/magento-cloud-docker/releases
134140
[magento-creds]: {{site.baseurl}}/guides/v2.3/install-gde/prereq/connect-auth.html
141+
[mutagen-install]: https://mutagen.io/documentation/introduction/installation/
135142
[services]: {{site.baseurl}}/cloud/docker/docker-containers.html#service-containers
136-
[xdebug]: {{site.baseurl}}/cloud/docker/docker-development-debug.html#configure-xdebug]
137143
[service keys]: {{site.baseurl}}/cloud/docker/docker-containers.html#service-configuration-options
138-
[dsync-install]: https://docker-sync.readthedocs.io/en/latest/getting-started/installation.html
139-
[mutagen-install]: https://mutagen.io/documentation/introduction/installation/
144+
[Synchronizing data in Docker]: {{site.baseurl}}/cloud/docker/docker-syncing-data.html
145+
[xdebug]: {{site.baseurl}}/cloud/docker/docker-development-debug.html#configure-xdebug]

src/cloud/docker/docker-mode-production.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ To launch the Docker environment in production mode:
2121
1. Install the template dependencies and add the default hostname to your `/etc/hosts` file, use the following command to run the Docker initialization script:
2222

2323
```bash
24-
curl https://raw.githubusercontent.com/magento/magento-cloud-docker/1.1.0/bin/init-docker.sh | bash
24+
curl https://raw.githubusercontent.com/magento/magento-cloud-docker/<package-version>/bin/init-docker.sh | bash
2525
```
2626

27-
If required, you can add options to the `init-docker.sh` initialization script to customize your Docker environment. Run the following command to see the available options:
27+
For `<package-version>`, use the [latest release of the {{site.data.var.mcd-package}}].
28+
29+
You can customize the options for the `init-docker.sh` initialization script your Docker environment. For example, you can specify the PHP version (default is 7.2) and the [Docker image version] (default 1.1). We recommend using the latest version of the Magento Cloud Docker images. Run the following command to see the available options:
2830

2931
```bash
3032
curl https://raw.githubusercontent.com/magento/magento-cloud-docker/1.1.0/bin/init-docker.sh | bash -s -- --help
@@ -97,6 +99,7 @@ To launch the Docker environment in production mode:
9799
- [`https://magento2.docker`](https://magento2.docker)
98100

99101
[cloud-repo]: https://github.com/magento/magento-cloud
102+
[Docker image version]: https://hub.docker.com/r/magento/magento-cloud-docker-php/tags
100103
[magento-creds]: {{site.baseurl}}/guides/v2.3/install-gde/prereq/connect-auth.html
101104
[services]: {{site.baseurl}}/cloud/docker/docker-containers.html#service-containers
102105
[configure Xdebug]: {{site.baseurl}}/cloud/docker/docker-development-debug.html#configure-xdebug

src/cloud/docker/docker-quick-reference.md

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,204 @@ Options:
111111
{:.bs-callout-info}
112112
See [Service versions] for additional information about the service configuration options for the `ece-docker build:compose` command.
113113

114+
### Build a custom Docker Compose configuration
115+
116+
Instead of building the `docker-compose.yaml` file using the {{site.data.var.ece }} project configuration. You can use the `build:custom:compose` command to build a custom `docker-compose.yaml` file with the configuration you supply. You provide the configuration as a JSON array as shown in [Example 1](#example-1).
117+
118+
For {{site.data.var.mcd-prod}} 1.2 and later, you have an additional option to specify custom images and image versions using the `ece-docker build:custom:compose` command as shown in [Example 2](#example-2).
119+
120+
#### Example 1
121+
122+
> Generate a custom `docker-compose.yaml` file
123+
124+
```bash
125+
./vendor/bin/ece-docker build:custom:compose '{"name":"magento","system":{"mode":"production","host":"magento2.test","port":"8080","db":{"increment_increment":3,"increment_offset":2},"mailhog":{"smtp_port":"1026","http_port":"8026"}},"services":{"php":{"version":"7.4","enabled":true,"extensions":{"enabled":["xsl"]}},"mysql":{"version":"10.2","image":"mariadb","enabled":true}, "mailhog": {"enabled":true}}}'
126+
```
127+
128+
This command generates the following `docker-compose.yaml` file:
129+
130+
```terminal
131+
version: '2.1'
132+
services:
133+
db:
134+
hostname: db.magento2.test
135+
image: 'mariadb:10.2'
136+
environment:
137+
- MYSQL_ROOT_PASSWORD=magento2
138+
- MYSQL_DATABASE=magento2
139+
- MYSQL_USER=magento2
140+
- MYSQL_PASSWORD=magento2
141+
ports:
142+
- '3306'
143+
volumes:
144+
- '.docker/mnt:/mnt:rw,delegated'
145+
- 'magento-magento-db:/var/lib/mysql'
146+
healthcheck:
147+
test: 'mysqladmin ping -h localhost -pmagento2'
148+
interval: 30s
149+
timeout: 30s
150+
retries: 3
151+
command: '--auto_increment_increment=3 --auto_increment_offset=2'
152+
networks:
153+
magento:
154+
aliases:
155+
- db.magento2.test
156+
fpm:
157+
hostname: fpm.magento2.test
158+
image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0'
159+
extends: generic
160+
volumes:
161+
- '.:/app:ro,delegated'
162+
- 'magento-vendor:/app/vendor:ro,delegated'
163+
- 'magento-generated:/app/generated:ro,delegated'
164+
- '.docker/mnt:/mnt:rw,delegated'
165+
networks:
166+
magento:
167+
aliases:
168+
- fpm.magento2.test
169+
depends_on:
170+
db:
171+
condition: service_healthy
172+
web:
173+
hostname: web.magento2.test
174+
image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0'
175+
extends: generic
176+
volumes:
177+
- '.:/app:ro,delegated'
178+
- 'magento-vendor:/app/vendor:ro,delegated'
179+
- 'magento-generated:/app/generated:ro,delegated'
180+
- '.docker/mnt:/mnt:rw,delegated'
181+
environment:
182+
- WITH_XDEBUG=0
183+
networks:
184+
magento:
185+
aliases:
186+
- web.magento2.test
187+
depends_on:
188+
fpm:
189+
condition: service_started
190+
varnish:
191+
hostname: varnish.magento2.test
192+
image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0'
193+
networks:
194+
magento:
195+
aliases:
196+
- varnish.magento2.test
197+
depends_on:
198+
web:
199+
condition: service_started
200+
tls:
201+
hostname: tls.magento2.test
202+
image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0'
203+
extends: generic
204+
networks:
205+
magento:
206+
aliases:
207+
- magento2.test
208+
environment:
209+
UPSTREAM_HOST: varnish
210+
ports:
211+
- '8080:80'
212+
- '443:443'
213+
depends_on:
214+
varnish:
215+
condition: service_started
216+
generic:
217+
hostname: generic.magento2.test
218+
image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0'
219+
env_file: ./.docker/config.env
220+
environment:
221+
- 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl'
222+
build:
223+
hostname: build.magento2.test
224+
image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0'
225+
extends: generic
226+
volumes:
227+
- '.:/app:rw,delegated'
228+
- 'magento-vendor:/app/vendor:rw,delegated'
229+
- 'magento-generated:/app/generated:rw,delegated'
230+
- '~/.composer/cache:/root/.composer/cache:rw,delegated'
231+
networks:
232+
magento-build:
233+
aliases:
234+
- build.magento2.test
235+
depends_on:
236+
db:
237+
condition: service_healthy
238+
deploy:
239+
hostname: deploy.magento2.test
240+
image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0'
241+
extends: generic
242+
volumes:
243+
- '.:/app:ro,delegated'
244+
- 'magento-vendor:/app/vendor:ro,delegated'
245+
- 'magento-generated:/app/generated:ro,delegated'
246+
- '.docker/mnt:/mnt:rw,delegated'
247+
networks:
248+
magento:
249+
aliases:
250+
- deploy.magento2.test
251+
depends_on:
252+
db:
253+
condition: service_healthy
254+
mailhog:
255+
hostname: mailhog.magento2.test
256+
image: 'mailhog/mailhog:latest'
257+
ports:
258+
- '1026:1025'
259+
- '8026:8025'
260+
networks:
261+
magento:
262+
aliases:
263+
- mailhog.magento2.test
264+
volumes:
265+
magento-vendor: { }
266+
magento-generated: { }
267+
magento-magento-db: { }
268+
networks:
269+
magento:
270+
driver: bridge
271+
magento-build:
272+
driver: bridge
273+
274+
```
275+
276+
For {{site.data.var.mcd-prod}} 1.2 and later, you have an additional option to specify custom images and image versions using the `ece-docker build:custom:compose` command.
277+
278+
#### Example 2
279+
280+
> Generate a custom `docker-compose.yaml` file with custom images and image versions
281+
282+
```bash
283+
./vendor/bin/ece-docker build:custom:compose '{"name":"magento","system":{"mode":"production","host":"magento2.test","port":"8080","db":{"increment_increment":3,"increment_offset":2},"mailhog":{"smtp_port":"1026","http_port":"8026"}},"services":{"php":{"image":"php-v1","version":"7.4","enabled":true},"php-cli":{"image-pattern":"%s:%s-cli"},"php-fpm":{"image-pattern":"%s:%s-fpm"},"mysql":{"image":"mariadb-v1","version":"10.3","image-pattern":"%s:%s","enabled":true},"redis":{"image":"redis-v1","enabled":"true","version":"5"},"elasticsearch":{"image":"elasticsearch-v1","image-pattern":"%s:%s","enabled":true,"version":"7.6"},"varnish":{"image":"varnish-v1","image-pattern":"%s:%s","enabled":true,"version":"6.2"},"nginx":{"image":"nginx-v1","version":"1.19","image-pattern":"%s:%s","enabled":"true"},"test":{"enabled":true}},"mounts":{"var":{"path":"var"},"app-etc":{"path":"app\/etc"},"pub-media":{"path":"pub\/media"},"pub-static":{"path":"pub\/static"}}}'
284+
```
285+
286+
This command generates the following images in the Docker environment:
287+
288+
```conf
289+
services:
290+
db:
291+
image: 'mariadb-v1:10.3'
292+
redis:
293+
image: 'redis-v1:5'
294+
fpm:
295+
image: 'php-v1:7.4-fpm'
296+
web:
297+
image: 'nginx-v1:1.19'
298+
varnish:
299+
image: 'varnish-v1:6.2'
300+
tls:
301+
image: 'nginx-v1:1.19'
302+
test:
303+
image: 'php-v1:7.4-cli'
304+
generic:
305+
image: 'php-v1:7.4-cli'
306+
build:
307+
image: 'php-v1:7.4-cli'
308+
deploy:
309+
image: 'php-v1:7.4-cli'
310+
```
311+
114312
## Magento Cloud Docker CLI
115313

116314
The `bin/magento-docker` commands simplify running docker-compose tasks. For example, instead of running a separate docker-compose command for the build, deploy, and post-deploy steps, you can _redeploy_ Magento in a Docker environment using the following command:

0 commit comments

Comments
 (0)