Search code examples
windowsdockerdocker-composelaradock

Laradock: docker-compose.yml is invalid format (PORT[/PROTOCOL]) on Windows


I try to follow the Laradock getting started tutorial on windows: http://laradock.io/getting-started/

I have the following tools:

Docker version: 20.10.5, build 55c4c88
git version: 2.30.2.windows.1
Windows 10 20H2(19042.867)

I get stuck on the step when trying to start the: docker-compose up -d nginx mysql

Then I get these error:

ERROR: The Compose file '.\docker-compose.yml' is invalid because:
services.proxy.expose is invalid: should be of the format 'PORT[/PROTOCOL]'
services.proxy2.expose is invalid: should be of the format 'PORT[/PROTOCOL]'
services.proxy.ports contains an invalid type, it should be a number, or an object
services.proxy2.ports contains an invalid type, it should be a number, or an object
...
services.sqs.ports contains an invalid type, it should be a number, or an object
services.sqs.ports contains an invalid type, it should be a number, or an object
services.traefik.ports value [':', ':', ':'] has non-unique elements

Only change I done to the repo is to add the env file and this line:

# Point to the path of your applications code on your host
APP_CODE_PATH_HOST=../project-z/

I also created the folder project-z

I saw this text quote but didn´t understand it:

Depending on the host’s operating system you may need to change the value given to COMPOSE_FILE. When you are running Laradock on Mac OS the correct file separator to use is :. When running Laradock from a Windows environment multiple files must be separated with ;.

But think it might be related to my issue and I need to update something to make it work on Windows.

Any idea what could be wrong? Since it almost out of the box I assume it´s something with my Windows environment


Solution

  • I found the solution directly after posted this question.

    It was very easy I forgot to add the "." before env when created the file.

    I found the solution here: https://github.com/laradock/laradock/issues/1437