【发布时间】:2020-11-20 12:43:57
【问题描述】:
我有一个 python 脚本,它从用户处理该文件获取输入文件路径,并在终端中用户指定的位置提供输出文件。下面是我的代码,它采用文件路径。
inputfilepath = input("Enter the input file path")
print(inputfilepath)
outputfilepath = input("Enter the output file path")
print(outputfilepath)
inputPath = inputfilepath
如果我在 Pycharm 中运行此 python 代码,它可以正常工作,但如果我创建相同代码的 docker 映像并输入输入文件路径,它会给出“找不到文件错误”。
Providing the input and output file path to the running container
和
因为如果我给出主机/本地机器的文件路径,它会在容器的工作目录中搜索该路径,而不是在本地机器中。
如何让容器搜索本地文件系统上的文件路径? 提前致谢!
【问题讨论】:
标签: python docker containers