Nginx Error
Skaywalker opened this issue · 1 comments
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
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.
Also, consider the following :
- Switch to WSL 2 backend for Docker Desktop if you're not already using it.
- Make sure you're using the latest version of Docker Desktop for Windows.