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
Copy file name to clipboardExpand all lines: guides/v2.0/install-gde/docker/docker-ref.md
+28-1Lines changed: 28 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -275,7 +275,10 @@ The following DevBox scripts and configuration files are located in the root fol
275
275
*`m2devbox-init.[bat|sh]` which starts the DevBox installation.
276
276
*`m2devbox-reset.[bat|sh]` which restarts the DevBox installation.
277
277
278
-
You can run this script, for example, after you stop and start your computer or Docker. DevBox assigns new ports to services; to find the new ports, see [Stop, start, restart, and view port mappings]({{ page.baseurl }}install-gde/docker/docker-commands.html#cloud-docker-cmds-stopstart).
278
+
You can run this script, for example, after you stop and start your computer or Docker. DevBox assigns new ports to services. You can do the following:
279
+
280
+
* To set static listen ports that don't change every time you restart a container, see [Set static listen ports](#devbox-static-port)_before_ you run `m2devbox-init.[bat|sh]`
281
+
* To find the listen ports currently being used, see [Stop, start, restart, and view port mappings]({{ page.baseurl }}install-gde/docker/docker-commands.html#cloud-docker-cmds-stopstart).
279
282
280
283
*`docker-compose.yml` DevBox configuration file.
281
284
@@ -289,5 +292,29 @@ When you run the installation script on Windows, an additional command window op
289
292
Do not close the Unison sync window; otherwise, files you change won't be added to the Magento docroot.
290
293
</div>
291
294
295
+
### Set static listen ports {#devbox-static-port}
296
+
By default, every time you start a Docker container, all listen ports are reassigned randomly. To cause DevBox to use the same listen ports every time you restart, you must modify `docker-compose.yml`_before you initialize_ DevBox for the first time.
297
+
298
+
To set static listen ports:
299
+
300
+
1. Open `docker-compose.yml` in a text editor.
301
+
302
+
It's located in the root directory to which you downloaded DevBox.
303
+
2. Locate the `ports:` section.
304
+
3. Precede the default listen port with a free port number followed by `:`
305
+
306
+
An example follows.
307
+
308
+
ports:
309
+
- "12345:80"
310
+
- "54321:22"
311
+
312
+
The preceding example causes the web container to listen on port 12345 and SSH to listen on port 54321.
0 commit comments