Docker:无法计算缓存密钥:&quord; quirements.txt"找不到:找不到
我尝试使用以下命令来构建Docker映像:
Docker Build - < Dockerfile
我在应用程序的主要目录中完成了此操作。我在文档“如何构建Docker映像”中找到了此命令。但是,由于失败而失败的构建:
无法计算缓存键:“/requirements.txt”找不到:找不到
我的test-app结构看起来像:
.
+-- src
| +-- static
| +-- templates
| +-- app.py
+-- Dockerfile
+-- requirements.txt
我不是docker专家,有几个说明。有些令人沮丧。其他堆栈溢出问题无法解决我的问题。
我在做什么错?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一番调查并尝试一下,我找到了以下解决方案:
命令
docker build-> Dockerfile
有些错误。不知道它是过时的还是不完整的。但是,我使用以下命令,并且可以使用:
docker build -tag docker_example。
非常重要的是and and and。没有这个,它将无效。它告诉Docker使用哪个Dockerfile。
如果您有一个“自定义” dockerfile名称,例如“ sothing.dockerfile”,则必须添加-f选项,然后添加dockerfile的名称才能构建正确的dockerfile。
示例:
docker build -tag docker_example -f somings.dockerfile。
After some investigation and try out i found the following solution:
The command
docker build -> Dockerfile
was somehow wrong. Don't know if it is outdated or incomplete.However i used the following command and it worked:
docker build --tag docker_example .
Very important is the dot at the and. Without this it will not work. It tells Docker which Dockerfile to use.
If you have a "custom" Dockerfile name like "something.Dockerfile" you have to add the -f option followed by the name of your Dockerfile to build the right one.
Example:
docker build --tag docker_example -f something.Dockerfile .