简体   繁体   English

带有安装文件的Docker挂载卷目录

[英]Docker Mount Volume Directory with Install Files

I'm working on building a Docker image for Plex Media server. 我正在为Plex Media服务器构建Docker映像。 I'm trying to integrate it with Plex Remote Transcoder which requires access to /var/lib/plexmediaserver on the container. 我正在尝试将其与需要访问容器上的/ var / lib / plexmediaserver的Plex Remote Transcoder集成。 This directory is the install directory for Plex. 该目录是Plex的安装目录。

My problem is that mounting a volume on startup just mounts the host directory to the container. 我的问题是在启动时挂载卷只会将主机目录挂载到容器。

How do I mount a populated directory inside the container to my host? 如何将容器内的填充目录安装到主机?

You create and mount data volume container 创建并安装数据卷容器

Your Plex Media image declares a volume for /var/lib/plexmediaserver, and its Dockerfile make sure that /var/lib/plexmediaserver is properly filled. 您的Plex Media映像声明了/ var / lib / plexmediaserver的卷,并且其Dockerfile确保正确填充了/ var / lib / plexmediaserver。

Then any plex remote transcoder container would be run with --volumes-from <plexMediaServerContainer> : it would see the content of /var/lib/plexmediaserver in its container. 然后,任何plex远程代码转换器容器都将通过--volumes-from <plexMediaServerContainer> :它将在其容器中看到/var/lib/plexmediaserver的内容。

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

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