简体   繁体   中英

Unable to run docker compose from WSL 2 Ubuntu

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?

在此处输入图片说明

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM