refactorian / laravel-docker

Laravel Docker Template - Laravel v11.x, PHP v8.3.x, MySQL v8.1.x, phpMyAdmin v5.x, Mailpit v1.x
286 stars 117 forks source link

Nginx Error #50

Closed Skaywalker closed 7 months ago

Skaywalker commented 7 months ago

Hi.

I need a little help, I'm not a docker specialist. Maybe I just overlooked something. But when I want to call docker, nginx crashes with the following error.

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/run/desktop/mnt/host/d/Project/laravel-docker/.docker/nginx/nginx.conf" to rootfs at "/etc/nginx/nginx.conf": mount /run/desktop/mnt/host/d/Project/laravel-docker/.docker/nginx/nginx.conf:/etc/nginx/nginx.conf (via /proc/self/fd/9), flags: 0x5000: 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

Thank you in advance for your help Képernyőkép 2024-03-24 191400

refactorian commented 7 months ago

Hi @Skaywalker 👋 I guess you're using Windows but I'm not very familiar with Windows Docker.

So far I can tell that Docker Desktop for Windows requires you to explicitly grant access to the directories you want to mount into containers. When you ran the docker compose up -d --build command, you should've got something like the below picture. You've to share the directories with Docker. Try removing everything from Docker and doing it again.

image

Also, consider the following :