简体   繁体   English

为什么从容器内部复制到已安装文件夹的文件没有出现在主机文件夹中?

[英]Why are files copied to mounted folder from inside the container not appearing in the host folder?

When I mount a host folder to my neo4j container the files from in that folder appear inside the containers directory and things work. 当我将一个主机文件夹安装到我的neo4j容器中时,该文件夹中的文件就会出现在容器目录中,并且一切正常。 However files that are inside the containers directory do not appear in the corresponding host folder - like the config file inside the container, located in the mounted conf folder. 但是,容器目录内的文件不会出现在相应的主机文件夹中-类似于容器内的配置文件,该文件位于已挂载的conf文件夹中。

version: "3"
services:
  cneo4j:
    image: neo4j:3.3.5
    container_name: cneo
    ports:
      - "7474:7474"
      - "7687:7687"
    environment:
      - VIRTUAL_PORT=80
      - VIRTUAL_HOST=db.localhost.vm
      - VIRUAL_ENABLE_SSL=True
      - LETSENCRYPT_HOST=db.localhost.vm
      - LETSENCRYPT_EMAIL=email@example.com
      - CERT_NAME=db.localhost.vm
    volumes:
      - /c/Users/moeter/cmcr/data/graph_main/neo4j/data:/data:rw
      - /c/Users/moeter/cmcr/data/graph_main/neo4j/logs:/logs:rw
      - /c/Users/moeter/cmcr/data/graph_main/neo4j/conf:/conf:rw
    restart: always

I am using Docker Toolbox for Windows. 我正在使用Windows的Docker Toolbox。

A host volume will always map to the contents of the host directory, there is no merging of contents from the image or initialization of the host directory from the image. 主机卷将始终映射到主机目录的内容,不会合并映像中的内容,也不会初始化映像中的主机目录。 The process of populating the host directory has to be done by your container entrypoint or command. 填充主机目录的过程必须由您的容器入口点或命令完成。 If there's initial data you want to load, that will need to be saved elsewhere in the image since you cannot access the image folder contents of they are hidden under a volume mount. 如果要加载初始数据,则需要将其保存在映像中的其他位置,因为无法访问映像文件夹的内容隐藏在卷装载中。

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

相关问题 将文件从 docker 容器复制到主机,或镜像文件夹 - copy files from docker container to host, or mirror a folder 检测正在将文件复制到文件夹中 - Detecting that files are being copied in a folder 无法将文件移动到挂载的网络共享文件夹 - unable to move files to mounted network share folder 从Linux机器将mySQLdump转储到远程服务器上的已安装Windows文件夹 - mySQLdump from Linux machine to a mounted Windows folder on a remote server 从本地linux文件夹移动到使用cifs挂载的Windows共享 - Move from local linux folder to a windows share mounted with cifs 链接到已安装的Windows文件夹的符号链接不起作用 - symlink to mounted windows folder not working 使用 windows 上的 docker 卷(仅在 docker 容器内部)或与主机操作系统安装/共享卷时,读/写性能是否更好? - Is read/write performance better with docker volumes on windows (inside of a docker container only) or a mounted / shared volume with host OS? 从文件夹中删除文件[Windows] - Delete files from folder [Windows] 将文件从lnk文件的文件夹复制回文件夹 - Copy files from folder of lnk files back into folder CYGWIN无法获取已安装文件夹上的磁盘使用情况 - Unable to get disk usage on mounted folder with CYGWIN
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM