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
{{ message }}
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
This topic lists Docker commands you might find useful for day-to-day use or when troubleshooting issues. For more information, see the [Docker command reference](https://docs.docker.com/engine/reference/commandline){:target="_blank"}.
14
14
15
-
## Enable cron
16
-
By default, cron isn't running in your Magento DevBox because cron consumes resources on your machine. Enabling cron also causes delays if you're running tests.
15
+
## Run cron, populate the cache and the storefront
17
16
18
-
Enabling cron is necessary, however, to demonstrate how Magento works and to perform certain tasks. For a discussion of how Magento uses cron, see [Configure and use cron]({{ page.baseurl }}config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-overview).
17
+
Populating the cache and storefront causes the storefront, products, and images to load faster. Use this option after you make changes to the product catalog to pre-deploy static assets and put objects in the cache so the storefront loads faster.
19
18
20
-
### Enable cron on a running system
21
-
If DevBox is running, use the following command:
19
+
You can also start the [Magento cron job]({{ page.baseurl }}config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-overview).
20
+
21
+
However, enabling these options consumes resources and might drain your battery.
22
+
23
+
{% collapsibleh3 Populate the storefront and cache and run cron (running system) %}
24
+
25
+
This section discusses how to populate the cache and storefront, and run cron, on a running DevBox system.
26
+
27
+
#### Start the Magento cron job and populate the cache
28
+
Use the following command to both start the [Magento cron job]({{ page.baseurl }}config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-overview) and populate the cache and storefront:
22
29
23
30
docker-compose exec --user=magento2 web m2init magento:finalize --magento-warm-up-storefront=1 --magento-cron-run=1 --no-interaction
24
31
25
-
### Enable cron to run every time Magento starts
26
-
To enable cron to run every time:
32
+
#### Start the Magento cron job only
33
+
Use the following command on a running system to only start the Magento cron job. This command might save resources and battery life on your laptop.
34
+
35
+
docker-compose exec --user=magento2 web m2init magento:finalize --magento-cron-run=1 --no-interaction
36
+
37
+
#### Populate the storefront and cache only
38
+
Use the following command on a running system to only populate the storefront and cache but _not_ run the Magento cron job.
39
+
40
+
docker-compose exec --user=magento2 web m2init magento:finalize --magento-warm-up-storefront=1 --no-interaction
41
+
42
+
{% endcollapsibleh3 %}
43
+
44
+
{% collapsibleh3 Configure DevBox to always populate the storefront and cache and run cron %}
45
+
46
+
To populate the storefront and cache, and run cron to run every time Magento starts:
27
47
28
48
1. Stop all running containers.
29
49
30
50
docker-compose stop
31
51
2. Open `<project root dir>/docker-compose.yml` in a text editor.
32
-
3. Set the values of the following parameters to `1`:
52
+
3. You have the following options:
53
+
54
+
* To enable cron to run only, set the value of the following parameter to `1`:
55
+
56
+
MAGENTO_CRON_RUN=1
57
+
* To only populate the storefront and cache but _not_ run the Magento cron job, set the value of the following parameter to `1`:
58
+
59
+
MAGENTO_WARM_UP_STOREFRONT=1
60
+
* To both enable the Magento cron job and to always populate the storefront and cache, set the values of both of the following parameters to `1`:
61
+
62
+
MAGENTO_CRON_RUN=1
63
+
MAGENTO_WARM_UP_STOREFRONT=1
33
64
34
-
MAGENTO_CRON_RUN=1
35
-
MAGENTO_WARM_UP_STOREFRONT=1
36
65
4. Save your changes to `docker-compose.yml` and exit the text editor.
37
66
5. Start all containers.
38
67
39
68
docker-compose start
40
-
41
-
## General purpose commands
42
69
70
+
{% endcollapsibleh3 %}
71
+
72
+
{% collapsibleh2 General purpose commands %}
73
+
43
74
| Description | Command |
44
75
|--------------|--------------|
45
76
| List all Magento containers |`docker-compose ps `|
@@ -52,5 +83,6 @@ To enable cron to run every time:
52
83
| Remove all Magento containers |`docker-compose kill`|
53
84
| Run a bash shell in a container |`docker-compose exec --user=magento2 <service> /bin/bash`|
Copy file name to clipboardExpand all lines: guides/v2.0/install-gde/docker/docker-ref.md
+35-9Lines changed: 35 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ This section discusses prerequisites you must complete before you install the Ma
35
35
### Docker prerequisites
36
36
Before you continue, make sure you install and configure the following:
37
37
38
-
* Mac OS<!--and Windows-->: Install the [Docker software](https://www.docker.com/products/docker-toolbox){:target="_blank"}
38
+
* Mac OSand Windows: Install the [Docker software](https://www.docker.com/products/docker-toolbox){:target="_blank"}
39
39
* Windows 10 only:
40
40
41
41
* You must enable Hyper-V
@@ -48,8 +48,8 @@ Before you continue, make sure you install and configure the following:
48
48
You cannot work with Docker, VirtualBox, or Vagrant simultaneously on Windows 10.
49
49
</div>
50
50
51
-
#### Set up Docker file sharing
52
-
For the Magento application to work, the application must be installed in a directory that Docker uses for file sharing.
51
+
#### Set up Docker file sharing {#devbox-docker-file-share}
52
+
For the Magento application to work, the application must be installed in a folder that Docker uses for file sharing.
53
53
54
54
**Windows**
55
55
@@ -72,24 +72,39 @@ To set up Docker file sharing on the Mac OS:
72
72
2. From the pop-up menu, click **Preferences**.
73
73
3. In the Preferences dialog box, click the **File Sharing** tab.
74
74
75
-
This tab page displays all shared directories that Docker currently knows about. Make sure you install Magento in a directory listed on this tab page.
75
+
This tab page displays all shared directories that Docker currently knows about. Make sure you install Magento in a folder listed on this tab page.
76
76
5. To add additional directories, follow the prompts on your screen or consult Docker documentation.
77
77
78
78
{% endcollapsibleh2 %}
79
79
80
+
<pid="devbox-fileshare"></p>{% collapsibleh2 How DevBox uses file sharing %}
81
+
82
+
DevBox runs in a Docker container, which is also referred to as the _guest operating system_. The Magento files and folders are located on your _host operating system_ (Windows or Mac OS). To facilitate development, Magento files and directories are shared by the guest and host operating systems.
83
+
84
+
When you make a change to files, the changes are automatically synchronized, regardless of which files you change. (In other words, if you change files on the host operating system, those files are synchronized with the guest operating system and vice versa.)
85
+
86
+
Use the following guidelines:
87
+
88
+
* New Magento DevBox installations: Files are shared in the `shared/webroot` folder relative to your Magento installation root folder.
89
+
90
+
The Magento installation root folder is typically a subfolder of the folder in which you extracted the `.zip` file you download from Magento.
91
+
* If you use an existing Magento installation with DevBox: Files are shared in the location to which you downloaded Magento.
<pid="devbox-download">{% collapsibleh2 How to download Magento code %}
101
+
<pid="devbox-download"></p>{% collapsibleh2 How to download Magento code %}
87
102
88
103
This section applies to you if you use an existing Magento installation with DevBox. This means you first download the Magento software using either [Composer]({{ page.baseurl }}install-gde/prereq/integrator_install.html) or a [compressed archive]({{ page.baseurl }}install-gde/prereq/zip_install.html) but you don't _install_ the software.
89
104
90
105
Downloading a compressed archive has potential issues on the Mac OS, which extracts known compressed file types like `.zip` to a folder. The folder contains files that have to be copied in a particular way; otherwise, the Magento DevBox doesn't perform properly.
91
106
92
-
If you download a compressed archive on the Mac OS, you must make sure to copy _all_ of the Magento code to an empty folder. In particular, you must copy all Apache [distributed configuration files](http://httpd.apache.org/docs/current/howto/htaccess.html){:target="_blank"}, named `.htaccess`, to the folder. `.htaccess` files are located in several Magento directories, including in the root directory.
107
+
If you download a compressed archive on the Mac OS, you must make sure to copy _all_ of the Magento code to an empty folder. In particular, you must copy all Apache [distributed configuration files](http://httpd.apache.org/docs/current/howto/htaccess.html){:target="_blank"}, named `.htaccess`, to the folder. `.htaccess` files are located in several Magento directories, including in the root folder.
93
108
94
109
Failure to copy `.htaccess` files causes the Magento application to function incorrectly because URL redirects won't work.
95
110
@@ -99,7 +114,7 @@ When you download a file on the Mac OS, the file is usually located in the `/Use
To make sure your existing Magento installation works it with DevBox, create an empty directory and copy all of the contents of the Magento compressed file to it as follows:
117
+
To make sure your existing Magento installation works it with DevBox, create an empty folder and copy all of the contents of the Magento compressed file to it as follows:
@@ -236,6 +251,17 @@ To provide you more control over your Magento installation, we enable you to cho
236
251
237
252
{% endcollapsibleh2 %}
238
253
254
+
## After the DevBox wizard completes
255
+
After you finish the DevBox wizard, you're prompted to download a `.zip` file to any folder on your system. When you extract the `.zip` file, your operating system might create another folder.
In the preceding example, the user downloaded `build-18c4e4d3c5a541f37e9cffd35f1bf74e.zip` to the `C:\magento` folder. Extracting the `.zip` created a subfolder. The installation script you must run is located in the subfolder.
When you run the installation script on Windows, an additional command window opens for Unison sync. Do not close the Unison sync window; otherwise, files you change won't be added to the Magento docroot.
264
+
When you run the installation script on Windows, an additional command window opens for Unison sync. You don't normally need to interact with this command window.
265
+
266
+
Do not close the Unison sync window; otherwise, files you change won't be added to the Magento docroot.
@@ -25,25 +25,33 @@ The preceding error means that the directory into which you're trying to install
25
25
26
26
In this case, delete everything from `Users/me/somepath`
27
27
28
-
Make sure all files, including all hidden files, are removed from that directory and try again.
28
+
_Solution_: Make sure all files, including all hidden files, are removed from that directory and try again.
29
+
30
+
{% endcollapsibleh2 %}
31
+
32
+
{% collapsibleh2 Problem: Error displays in the Magento Admin %}
29
33
30
-
## Problem: Error displays in the Magento Admin
31
34
After you log in to the Magento Admin, the following notification error might display:
32
35
33
36
Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider.
34
37
35
38
This error results from the fact that the Magento application is running in developer mode. The message doesn't indicate any issues. You can ignore it and develop as normal.
36
39
37
-
## Problem: 404 error accessing the Magento Admin, storefront is accessible
40
+
{% endcollapsibleh2 %}
41
+
42
+
{% collapsibleh2 Problem: 404 error accessing the Magento Admin, storefront is accessible %}
43
+
38
44
When you access the Magento Admin, the following error displays in the browser:
39
45
40
46
The requested URL /admin was not found on this server.
41
47
42
48
However, you can access the Magento storefront.
43
49
44
-
The most likely cause of this error is missing `.htaccess` files the Magento application uses for URL redirects and other things. To resolve this error, if you use the Mac OS, see [How to download Magento code]({{ page.baseurl }}install-gde/docker/docker-over.html#devbox-download)
50
+
_Solution_: The most likely cause of this error is missing `.htaccess` files the Magento application uses for URL redirects and other things. To resolve this error, if you use the Mac OS, see [How to download Magento code]({{ page.baseurl }}install-gde/docker/docker-over.html#devbox-download)
51
+
52
+
{% endcollapsibleh2 %}
45
53
46
-
## Problem: Cannot access the Magento storefront or Admin
54
+
{% collapsibleh2 Problem: Cannot access the Magento storefront or Admin %}
47
55
48
56
If you are having trouble accessing your Magento storefront and Magento Admin, connect to the web container and run some additional commands.
49
57
@@ -61,8 +69,11 @@ If you are having trouble accessing your Magento storefront and Magento Admin, c
61
69
php bin/magento setup:static-content:deploy
62
70
5. When you're finished, enter `exit`.
63
71
64
-
## Problem: Errors display on Windows
65
-
During installation errors similar to the following display in your primary command window:
72
+
{% endcollapsibleh2 %}
73
+
74
+
{% collapsibleh2 Problem: Errors display on Windows %}
75
+
76
+
During installation, errors similar to the following display in your primary command window:
66
77
67
78
ERROR: for db Cannot create container for service db: C: drive is not shared. Please share it in Docker for Windows Settings
68
79
ERROR: Encountered errors while bringing up the project.
@@ -73,9 +84,12 @@ Other errors might display in a secondary command window:
73
84
Error response from daemon: No such container: magento2devbox_web_7f927cb82fd5dfc7d21b4d02387a0d12
74
85
Error: No such container: magento2devbox_web_7f927cb82fd5dfc7d21b4d02387a0d12
75
86
76
-
*Solution*: [Set up file sharing]()
87
+
*Solution*: [Set up file sharing]({{ page.baseurl }}install-gde/docker/docker-ref.html#devbox-docker-file-share).
88
+
89
+
{% endcollapsibleh2 %}
90
+
91
+
{% collapsibleh2 Problem: You want to start over %}
77
92
78
-
## Problem: You want to start over
79
93
In the event you want to start over with a new Magento application installation, use the following steps from the directory to which you copied the DevBox scripts:
80
94
81
95
1. Kill the Magento Docker containers.
@@ -89,6 +103,6 @@ In the event you want to start over with a new Magento application installation,
Copy file name to clipboardExpand all lines: guides/v2.0/mtf/create_test/create_new_test.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ title: Create a test in the Functional Testing Framework
6
6
menu_title: New functional test. Practice
7
7
menu_order: 3
8
8
version: 2.0
9
-
github_link: mtf/create_test/new_test.md
9
+
github_link: mtf/create_test/create_new_test.md
10
10
---
11
11
12
12
To demonstrate the usage of test components from previous sections in the test creation process, we will create a new functional [injectable test][] step-by-step. Before creating automated test, try to pass it manually.
0 commit comments