简体   繁体   English

Docker 个文件显示为文件夹

[英]Docker files showing up as folders

At the moment I have setup a simple lamp stack environment with docker. However, when I specify eg a php.ini file, the php.ini file shows up as a folder and not a specific ini file - which means that I cannot edit it.目前我已经用 docker 设置了一个简单的灯组环境。但是,当我指定例如 php.ini 文件时,php.ini 文件显示为一个文件夹而不是特定的 ini 文件 - 这意味着我无法编辑它.

some volumes context of my dockerfile:我的 dockerfile 的一些卷上下文:

volumes:
        - ./:/var/www/html
        - ./.docker/php/custom.ini:/usr/local/etc/php/php.ini

演出

What am I missing?我错过了什么? php.ini should be a file, and not a folder, no?. php.ini 应该是一个文件,而不是一个文件夹,不是吗?

Directories are created whenever Docker cannot find the file specified, leading to it assuming you want it created.每当 Docker 找不到指定的文件时,就会创建目录,导致它假定您希望创建它。

Don't use relative directories in volume mounts, always use the full path, for example by prefixing your bind mount with $(pwd) .不要在卷挂载中使用相对目录,始终使用完整路径,例如在绑定挂载前加上前缀$(pwd)

If you're a Docker Desktop user, make sure you have allowed the given path to be mounted as volume.如果您是 Docker 桌面用户,请确保您已允许将给定路径作为卷安装。

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

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