Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit e1d4ee2

Browse files
committed
Issue #1366: Continue touching up Docker documentation.
1 parent 0799427 commit e1d4ee2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

docs/other/docker.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ You can also add other subdomains if you're using other built-in services, e.g.
2525

2626
The [`geerlingguy/drupal-vm`](https://hub.docker.com/r/geerlingguy/drupal-vm/) image on Docker Hub contains a pre-built copy of Drupal VM, with all the latest Drupal VM defaults. If you need to quickly run your site in a container, or don't need to customize any of the components of Drupal VM, you can use this image.
2727

28+
> For a reference installation that has configuration for running the local environment on _either_ Vagrant or Docker, see the [Drupal VM Live Site Repository](https://github.com/geerlingguy/drupalvm-live).
29+
2830
### (Optional) Add a `Dockerfile` for customization
2931

3032
If you need to make small changes to the official `drupal-vm` image (instead of baking your own fully-custom image), you can create a `Dockerfile` to make those changes. In one site's example, ImageMagick was required for some media handling functionality, and so the following `Dockerfile` was places in the project's root directory (alongside the `docker-compose.yml` file):
@@ -43,9 +45,10 @@ You can customize the official image in many other ways, but if you end up doing
4345

4446
Copy the `example.docker-compose.yml` file out of Drupal VM (or grab a copy from GitHub [here](https://github.com/geerlingguy/drupal-vm/blob/master/example.docker-compose.yml)), rename it `docker-compose.yml`, and place it in your project root.
4547

46-
_If you are using your own `Dockerfile` to further customize Drupal VM_, comment out the `image: drupal-vm` line, and uncomment the `build: .` line (this tells Docker Compose to build a new image based on your own `Dockerfile`).
48+
- _If you are using your own `Dockerfile` to further customize Drupal VM_, comment out the `image: drupal-vm` line, and uncomment the `build: .` line (this tells Docker Compose to build a new image based on your own `Dockerfile`).
49+
- _If you're not using your own `Dockerfile`_, change the `image` line to: `image: geerlingguy/drupal-vm`.
4750

48-
For the `volume:` definition in `docker-compose.yml`, Drupal VM's default site docroot is `/var/www/drupalvm/drupal/web`, which follows the convention of a typical Drupal project built with Composer. If you don't get your site when you attempt to access Drupal VM, you will either need to modify the `volume:` definition to match your project's structure, or use a custom `Dockerfile` and copy in a customized Apache `vhosts.conf` file.
51+
For the `volume:` definition in `docker-compose.yml`, Drupal VM's default docroot is `/var/www/drupalvm/drupal/web`, which follows the convention of a typical Drupal project built with Composer. If you don't get your site when you attempt to access Drupal VM, you will either need to modify the `volume:` definition to match your project's structure, or use a custom `Dockerfile` and copy in a customized Apache `vhosts.conf` file.
4952

5053
### Run Drupal VM
5154

@@ -62,6 +65,12 @@ After the Drupal VM container is running, you should be able to see the Dashboar
6265
6366
You can stop the containers with `docker-compose stop`, or remove all their configuration with `docker-compose down`.
6467

68+
### Using Drush inside Docker
69+
70+
Currently, the easiest way to use Drupal VM's `drush` inside a Docker container is to use `docker exec` to run `drush` internally. There are a few other ways you can try to get Drush working with a codebase running on a container, but the easiest way is to run a command like:
71+
72+
docker exec drupal-vm bash -c "drush --uri=drupalvm.dev --root=/var/www/drupalvm/drupal/web status"
73+
6574
## Method 2: 'Bake and Share' a custom Drupal VM Docker image
6675

6776
If you need a more customized Drupal VM instance, it's best to build your own with Drupal VM's built-in Docker scripts.

0 commit comments

Comments
 (0)