Having Issues with Docker Compose on Windows 11

0
2
Asked By NinjaCat543 On

I'm relatively new to Docker and I'm trying to set up a cluster with three containers. Everything works fine when I run `docker compose up`, but when I modify my `docker-compose.yml` file to include a build context and then run `docker compose up --build`, I'm experiencing some strange issues with file paths. It seems like the context can't find files that are definitely present. I noticed that if I build the images manually, everything works, but when I use compose, it fails. I'm running Docker on Windows 11, and I suspect there might be an issue with how Windows paths translate to Linux paths. Can anyone help me figure this out?

5 Answers

Answered By TechGuru88 On

What command are you running and from which directory? Can you describe what's in your compose file and share the exact error message you’re seeing? The more details you provide, the better we can help!

NinjaCat543 -

I've updated the main post to include more specific details.

Answered By PathFinder00 On

Have you tried using relative paths in your compose file? Sometimes Docker can struggle with absolute Windows paths.

Answered By WindowsWhiz On

From what I understand, Docker runs Linux containers inside a virtual machine when you're on Windows. So, you'll want to ensure that the context in your compose file is accessible within that VM. Your files on the C: drive may not be visible unless configured correctly.

Answered By DockerMaster99 On

Just a heads up, when you run the `build` command, Docker expects a Dockerfile named 'Dockerfile' unless you specify a different one using `-f`. Your command with `-f` is working because you're explicitly stating the Dockerfile name, which is good!

Answered By DockerDude42 On

I don't have much experience with Docker Desktop but I found this GitHub issue that might relate to your problem: https://github.com/docker/compose/issues/11421. Check if that helps!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.