0

I am trying to run docker-compose up -d --build from Ubuntu (Windows WSL 2). I have enabled the WSL integration as per the steps listed here. Docker and compose are working from my Ubuntu terminal as shown in the screenshot below but it gives me the error complaining that "Error response from daemon: path ... is mounted on / but it is not a shared mount". How should I resolve this issue?

enter image description here

Vipin Verma
  • 5,330
  • 11
  • 50
  • 92
  • Have you seen this answer for similar question? https://stackoverflow.com/a/68455665/4676641 – cam Oct 15 '21 at 02:09
  • You posted [this question](https://stackoverflow.com/q/69578573/4676641) too and have trailing slashes on your docker-compose so I think the previous link applies in this case – cam Oct 15 '21 at 02:11
  • Yes, I posted previous question too. since nothing worked i tried to use wsl approach mentioned in one of the answers which did not work either.. entire day wasted by this docker. someone mentioned that re-installing may work. so trying that. – Vipin Verma Oct 15 '21 at 02:13
  • If you haven't tried already, you may want to remove the trailing `/` in your docker-compose volumes since your error seems very similar to the one discussed here: https://stackoverflow.com/a/68455665/4676641 – cam Oct 15 '21 at 02:19
  • yes, I re-installed everything and removed the slashes too. it seems to work.. – Vipin Verma Oct 15 '21 at 02:24
  • it worked but gave me another error down the road `Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/usr/src/app/entrypoint.sh": permission denied: unknown`. using sudo did not work – Vipin Verma Oct 15 '21 at 02:26
  • Please search for existing answers to that error or create a separate thread. The error is completely unrelated to the volume discussion. However, that seems like a permissions issue with your `entrypoint.sh` script and might be solved by `chmod +x entrypoint.sh`. I'd suggest moving further discussion to chat if that doesn't help. – cam Oct 15 '21 at 02:30
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/238158/discussion-between-vipin8169-and-tentative). – Vipin Verma Oct 15 '21 at 02:40

1 Answers1

3

Posting this as an answer for easier reading.

As mentioned in the comments, the solution appeared to be removing slashes from volumes as suggested by this similar question and answer:

From this:

    volumes:
      - ./server/:/usr/src/app/

To this:

    volumes:
      - ./server:/usr/src/app

Snippet from user's related question here.

cam
  • 4,409
  • 2
  • 24
  • 34