'docker: failed to compute cache key: "/requirements.txt" not found: not found
I tried to build a docker image with the following command:
docker build -< Dockerfile
I did it in the mail directory of the app. I found this command somewhere in a documentation "how to build a docker image". However the build failed with failure:
failed to compute cache key: "/requirements.txt" not found: not found
My test-app structure looks like:
.
+-- src
| +-- static
| +-- templates
| +-- app.py
+-- Dockerfile
+-- requirements.txt
I'm not a docker expert and there are several instructions out there. It's somehow frustrating. Other stack overflow questions did not solve my issue.
What am I doing wrong?
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kadlu |
