Notes on how to get https://github.com/greenpeace/planet4-docker-compose up and running on windows using WSL.
-
Use windows 10 pro 1809+ and profressional with docker for windows
-
install latest ubuntu on WSL (18.04) from microsoft store
-
Update windows hosts file with paths: add:
127.0.0.1 www.planet4.test
127.0.0.1 pma.www.planet4.test
127.0.0.1 traefik.www.planet4.test
to C:\Windows\System32\drivers\etc\hosts (edit with admin rights)
-
Share the drive that the repo is on in the docker desktop settings (this can be flaky with firewalls, sometimes I have to run
Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private
from an elevated powershell after disabling the share, then reenabling the share. Thread here: https://stackoverflow.com/questions/42203488/settings-to-windows-firewall-to-allow-docker-for-windows-to-share-drive/43904051) -
Run from ubuntu
sudo apt-get update
sudo apt-get install git make docker.io docker-compose yarn curl gulp shellcheck yamllint jq golang-go socat unzip
-
Follow https://blogs.technet.microsoft.com/virtualization/2017/12/08/wsl-interoperability-with-docker/#comments except we have already installed Go and socat. You might need to install go like described here instead of via apt.
-
Check out https://github.com/greenpeace/planet4-docker-compose with UNIX file endings! (disable autoCRLF)
-
Paths in the docker-compose yaml files for volumes need to be updated to reflect the windows path, they won't work with the relative paths. e.g.
image: mysql:5.7
env_file:
- ./db.env
volumes:
- db:/var/lib/mysql
- ./defaultcontent:/docker-entrypoint-initdb.d
networks:
- db
labels:
traefik.enable: "false"
should be updated to:
image: mysql:5.7
env_file:
- ./db.env
volumes:
- db:/var/lib/mysql
- /c/Users/robin/clients/outlandish/greenpeace/planet4-docker-compose/defaultcontent:/docker-entrypoint-initdb.d
networks:
- db
labels:
traefik.enable: "false"
These need updating on the db, php-fpm and openresty configs.
-
The unzipimages make task errors - add
@mkdir -p persistence/app/public/wp-content/uploads
before the unzip in Makefile -
It may be that COMPOSE_CONVERT_WINDOWS_PATHS environment varialble might negate this change but I haven't got it to work. Nick Sellen suggested something like this: ${MOUNT_PREFIX:-}${PWD}/path/to/mount/source:/and/the/dest to make it work cross platform.
-
Sometimes
make run
(part ofmake build
) fails and needs to be run a few times before all the docker images come up correctly. If this happens while runningmake build
then you have to go through and run the remaining make tasks manually. Also can happen withmake stop
. -
If make build gets stuck on the ......... it's worth cancelling and running
make run
again. -
This all seems to work better on my more powerful workstation. On my less powerful laptop it can get bogged down with pipe errors through to docker and can all run fairly slowly. Once it's all running though it's fine.