简体   繁体   English

无法从 WSL 2 Ubuntu 运行 docker compose

[英]Unable to run docker compose from WSL 2 Ubuntu

I am trying to run docker-compose up -d --build from Ubuntu (Windows WSL 2).我正在尝试从 Ubuntu(Windows WSL 2)运行docker-compose up -d --build I have enabled the WSL integration as per the steps listed here .我已按照此处列出的步骤启用了 WSL 集成。 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". Docker 和 compose 正在我的 Ubuntu 终端上工作,如下面的屏幕截图所示,但它给了我一个错误,抱怨“来自守护进程的错误响应:路径......已安装在 / 但它不是共享安装”。 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 . 此处来自用户相关问题的片段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 WSL (Ubuntu) Bash 运行 Windows 可执行文件 - How can I run a Windows executable from WSL (Ubuntu) Bash 将Docker Windows WSL Ubuntu连接到VMware Ubuntu - Connecting Docker Windows WSL Ubuntu to VMware Ubuntu Docker 始终运行 Frozen 或 WSL Ubuntu 发行版在等待生命周期服务器时停止 - Docker run always Frozen or WSL Ubuntu distro stopped while waiting for Lifecycle server 无法连接到 unix:///var/run/docker.sock 上的 Docker 守护进程。 docker 守护进程是否正在运行? (Ubuntu 20.04,WSL2) - Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (Ubuntu 20.04 ,WSL2) WSL Ubuntu 20.04,在此 WSL 2 发行版中找不到命令“docker” - WSL Ubuntu 20.04, The command 'docker' could not be found in this WSL 2 distro wsl 上的 Docker-compose 无法在容器中启动终结器 - Docker-compose on wsl cannot start terminator in container Docker撰写yml“ volume”在Ubuntu OS上不起作用 - Docker compose yml “volume” not working on Ubuntu OS “tls:收到长度超过20527的超大记录”试图从Win10 WSL Bash“docker run” - “tls: oversized record received with length 20527” trying to “docker run” from Win10 WSL Bash only 不断从 WSL 上的 Ubuntu 登录不正确 - Keep getting login incorrect from Ubuntu on WSL 如何在Windows中使用docker-compose运行? - How to docker-compose run in windows?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM