【问题标题】:volume already exists but was not created by Docker Compose卷已经存在但不是由 Docker Compose 创建的
【发布时间】:2022-01-06 20:08:31
【问题描述】:

这是我在新项目或任何其他项目上使用 ddev start 后得到的。 我清除了所有 docker 图像、卷等...问题再次出现...

有没有人有同样的问题,和版本有关系吗:

  • Docker 版本 20.10.11
  • Docker Compose 2.2.0 版
  • ddev 版本 v1.18.0
Starting lmp... 
Pushed mkcert rootca certs to ddev-global-cache/mkcert 
Running   Command=ip address show dev docker0
volume "lmp-mariadb" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume 
Failed to start lmp: ComposeCmd failed to run 'COMPOSE_PROJECT_NAME=ddev-lmp docker-compose -f /home/loganmm/www/ddev/lmp/.ddev/.ddev-docker-compose-full.yaml up --build -d', action='[up --build -d]', err='exit status 1', stdout='Sending build context to Docker daemon     489B
Step 1/6 : ARG BASE_IMAGE
Step 2/6 : FROM $BASE_IMAGE
 ---> 87d5f9bd7e6e
Step 3/6 : ARG username
 ---> Using cache
 ---> f60cc0e22e2e
Step 4/6 : ARG uid
 ---> Using cache
 ---> 01e2924ff925
Step 5/6 : ARG gid
 ---> Using cache
 ---> f76f3c567045
Step 6/6 : RUN (groupadd --gid $gid "$username" || groupadd "$username" || true) && (useradd  -l -m -s "/bin/bash" --gid "$username" --comment '' --uid $uid "$username" || useradd  -l -m -s "/bin/bash" --gid "$username" --comment '' "$username" || useradd  -l -m -s "/bin/bash" --gid "$gid" --comment '' "$username")
 ---> Using cache
 ---> 74726db594e2
Successfully built 74726db594e2
Successfully tagged drud/ddev-dbserver-mariadb-10.3:v1.18.0-lmp-built
Sending build context to Docker daemon     448B
Step 1/6 : ARG BASE_IMAGE
Step 2/6 : FROM $BASE_IMAGE
 ---> 1e45807db7e2
Step 3/6 : ARG username
 ---> Using cache
 ---> 99d798f1aa8c
Step 4/6 : ARG uid
 ---> Using cache
 ---> 30f01bb39027
Step 5/6 : ARG gid
 ---> Using cache
 ---> db8269893144
Step 6/6 : RUN (groupadd --gid $gid "$username" || groupadd "$username" || true) && (useradd  -l -m -s "/bin/bash" --gid "$username" --comment '' --uid $uid "$username" || useradd  -l -m -s "/bin/bash" --gid "$username" --comment '' "$username" || useradd  -l -m -s "/bin/bash" --gid "$gid" --comment '' "$username")
 ---> Using cache
 ---> 059097a5008c
Successfully built 059097a5008c
Successfully tagged drud/ddev-webserver:v1.18.0-lmp-built
', stderr='volume "lmp-mariadb" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume' 

【问题讨论】:

    标签: docker docker-compose lamp ddev


    【解决方案1】:

    这已在 DDEV v1.18.2 中解决,请升级。这是 docker-compose 2.2.0+ 中的一个错误 - 请参阅 https://github.com/drud/ddev/issues/3404 了解上下文。

    【讨论】:

    • 你说得对,我降级到 docker-compose 2.0.1 并且它运行良好!!!谢谢哥们!
    • 对于那些使用 Docker Desktop for mac 的用户,其中 4.3.2 存在此错误:4.2.0 版附带较旧的、可工作的 docker-compose。下载地址:docs.docker.com/desktop/mac/release-notes/#docker-desktop-420
    • 但是请...如果您只使用 ddev v1.18.2... 没问题。
    【解决方案2】:

    如果您使用 Docker Desktop - 转到首选项并在 General 下取消选中 Use Docker Compose v2,然后单击“Apply & Restart” - 如在 https://github.com/drud/ddev/issues/3404#issuecomment-986990802 上找到的那样

    【讨论】:

    • 谢谢哥们,但我只使用 Linux。 Docker Compose 2.0.1 版现在运行完美......
    猜你喜欢
    • 1970-01-01
    • 2021-12-09
    • 1970-01-01
    • 2016-10-08
    • 2021-03-14
    • 2020-04-06
    • 2020-07-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多