[英]How mount directory from docker volume?
I have docker volume code and I would like map only one directory from this volume.我有 docker 卷代码,我希望 map 仅来自该卷的一个目录。
volumes:
- code:/var/www/html
Can I do that?我可以这样做吗?
volumes:
- code/xxx:/var/www/html
Can I only use host_path?我只能使用 host_path 吗?
You can map the directory xxx inside /var/www/html directory inside the container您可以 map 容器内 /var/www/html 目录内的目录 xxx
Try to use relative path:尝试使用相对路径:
volumes:卷:
-./code/xxx:/var/www/html -./code/xxx:/var/www/html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.