[英]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.