I am building craft cms in docker and I am getting the following error, when I execute docker-compose up
:
ERROR: for craftcms Cannot start service craftcms: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\"/host_mnt/c/src/composer.lock\\" to rootfs \\"/var/lib/docker/overlay2/b7084475699f911f17d38746b21b1b9694fedf6e096a4080109d429fa687a6db/merged\\" at \\"/var/lib/docker/overlay2/b7084475699f911f17d38746b21b1b9694fedf6e096a4080109d429fa687a6db/merged/var/www/composer.lock\\" caused \\"not a directory\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type ERROR: Encountered errors while bringing up the project.
Apparently, mounting directories in Windows OS is different than Linux OS. Could you please help me troubleshoot this?
UPDATE
From the docker-compose.yml, this is where I mount the files:
craftcms:
build:
context: .
dockerfile: ./infrastructure/docker/php-fpm/Dockerfile
expose:
- 9000
volumes:
- cpresources:/var/www/web/cpresources
- ./src/vendor:/var/www/vendor
- ./src/composer.json:/var/www/composer.json
- ./src/composer.lock:/var/www/composer.lock
- ./src/config:/var/www/config
- ./src/modules:/var/www/modules
- ./src/templates:/var/www/templates
- ./src/web:/var/www/web