Skip to content
Snippets Groups Projects
Name Last commit Last update
build-scripts
docroot
README.md
docker-compose.yml

WCMS Docker setup

You will need to get Docker (https://www.docker.com/products/docker-desktop) either Docker CE for Windows/Mac or Docker Toolbox for Windows (https://docs.docker.com/toolbox/toolbox_install_windows/) or Mac (https://docs.docker.com/toolbox/toolbox_install_mac/). If you plan to run VirtualBox and Docker you will need to install the Docker Toolbox, Docker CE requires Hyper-V to be enable which isn't compatible with VirtualBox.

CAUTION! This Docker box is meant for local development only. This set up is not hardened and is not secure, so only us it as a local development environment.

If you are using Docker Toolbox, on a Windows machine start Docker Quickstart Terminal.

From the command line, run:

       docker-machine ip

It will return the IP address of the Docker machine, you will need to add the Docker machine IP to your host file.

       git clone https://git.uwaterloo.ca/mnshantz/wcms-docker.git wcms-docker

Go into the directory you cloned Docker into:

       cd wcms-docker

First we need to build the images,(this takes about 12 minutes or so):

       docker-compose build 

Once that's done you can create the containers, running with -d runs them in detached mode:

       docker-compose up -d

If you get an error running docker-compose related to wincred go to ~/.docker/config.json and remove the "credstore":"wincred" but leave the curly braces {} and save the file.

To check that all the boxes are running:

       docker-compose ps

If all containers say up, you are good to proceed to the next step.

Next we will need to run the profile rebuild for either our Drupal 7 or Drupal 8 container:

go to the URL: http://docker:9000

You can use Portainer to easily log in to the web container to run the profile rebuild the base profile or run composer etc...

Go to Containers (http://docker:9000/#/containers) and under "Quick Actions" look for the console icon, it looks like this >_

On the Drupal 7 container you can log in as root on the Drupal 8 container change the log in to vagrant.

Once in, you can update the profile as you would using wcms-vagrant.

On Windows, if you get the error:

        un\\\\docker.sock:/var/run/docker.sock"\nis not a valid Windows path'

ERROR: for portainer  Cannot create container for service portainer: b'Mount denied:\nThe source path "\\\\var\\\\run\\\\docker.sock:/var/run/docker.sock"\nis not a valid Windows path'
Encountered errors while bringing up the project.

You will need to use Windows Powershell (as Admin) and enter:

        $Env:COMPOSE_CONVERT_WINDOWS_PATHS=1

IMPORTANT! If you run docker-compose kill you stop all the containers, if you run docker-compose up -d again the containers come back in the state you left them (so sites exsist that you created). If, after you run docker-compose kill you power off the Virtual Machine in vagrant (usually called default) then the next time you run docker-compose up -d it will rebuild the containers.