【问题标题】:Mount a volume in /var/www/html and the path doesn't find在 /var/www/html 中挂载一个卷,但找不到路径
【发布时间】:2019-11-29 15:32:22
【问题描述】:

我创建了这个 docker compose 文件:

 version: '3'

 services: 
   exercise1:
     image: tutum/apache-php
     ports:
        - '80:80'
     volumes:
        - exercise1:/var/www/html
 volumes:
  exercise1:

我从docker-compose up -d 开始,然后进入 /var/ 并且 www 文件夹不存在?任何人都可以帮助理解为什么?

【问题讨论】:

    标签: docker docker-compose yaml


    【解决方案1】:

    你要去/var/www你的主机,对吧?

    这是不正确的。在这种情况下,目录/var/www 位于容器内部

    您要查找的内容位于您的主机/var/lib/docker/volumes/exercise1/_data

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-21
      • 1970-01-01
      • 2016-04-15
      • 2020-09-15
      • 1970-01-01
      • 1970-01-01
      • 2020-05-27
      • 2023-03-22
      相关资源
      最近更新 更多