简体   繁体   English

Docker 中.Net Core 应用程序中的路径问题

[英]The trouble with the paths in .Net Core application in Docker

I have some problem.我有一些问题。 How to save in my.Net Core app into Docker container the file to a folder on the absolute path and not the relative path.如何在 my.Net Core 应用程序中将文件保存到 Docker 容器中的绝对路径而不是相对路径上的文件夹中。

My files save into /var/lib/docker/overlay2/19564d0bf/merged/app/Images/vehicle, but to need saving into /mnt/app/files/Images/vehicle我的文件保存到 /var/lib/docker/overlay2/19564d0bf/merged/app/Images/vehicle,但需要保存到 /mnt/app/files/Images/vehicle

Use mount with docker run:使用安装 docker 运行:

docker run -v /mnt/app/files/Images/vehicle:/YOUR_LOCAL_PATH imageName

Save file to YOUR_LOCAL_PATH, then you can find it at /mnt/app/files/Images/vehicle将文件保存到 YOUR_LOCAL_PATH,然后您可以在 /mnt/app/files/Images/vehicle 找到它

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

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