Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockercoins: docker-compose up fails on WSL2 #594

Closed
mikeliddell-outreach opened this issue Sep 21, 2021 · 2 comments
Closed

dockercoins: docker-compose up fails on WSL2 #594

mikeliddell-outreach opened this issue Sep 21, 2021 · 2 comments

Comments

@mikeliddell-outreach
Copy link

I tried running on my WSL and go the following

$ git clone https://github.com/jpetazzo/container.training
$ cd container.training
$ docker-compose up
⠋ Container dockercoins_webui_1  Creating                                                                                                                                                   0.0s Error response from daemon: path /home/mliddell/k8s-training/k8s/container.training/dockercoins/webui/files is mounted on / but it is not a shared mount.

The problem & fix is as described in https://stackoverflow.com/questions/68273745/how-to-make-a-mount-shared-in-docker

  • FIX: remove trailing slashes (/) from volumes definition.

Environment:

  • WSL2, docker desktop
  • Ubuntu host
  • all previous demos working.. ie docker in good shape.
@jpetazzo
Copy link
Owner

jpetazzo commented Oct 2, 2021

Hey, thanks for identifying this!

Apparently, this is a bug in Compose v2 on WSL:

docker/compose#8558

I like to keep trailing slahes in volume mounts to show clearly that we're mounting directories (not files or sockets), but... If it breaks it on Windows, that sucks :(

I'm going to keep it like this for now, hoping that Compose will fix it soon; and if it doesn't fix it, then we'll change the Compose file of course.

Thanks again!

@jpetazzo
Copy link
Owner

jpetazzo commented Dec 5, 2021

I tried with the latest version of Docker Destkop on Windows (4.3.0, which includes Compose 2.2.0) and it seems to work with a trailing slash 🎉

I'd like to keep the trailing slash, because there are a few other places (in Docker and otherwise) where it's necessary, for instance:

  • in a Dockerfile, using COPY with multiple files requires a trailing slash on the destination directory
  • when using rsync, trailing slashes are also a way to ensure that no extra subdirectory is created (i.e. it's good practice to do rsync -av foo/ bar/)

I'm going to close this issue, but thanks a lot for reporting and tracking this, I truly appreciate it!

@jpetazzo jpetazzo closed this as completed Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants