'failed to compute cache key: "/nginx/default" not found: not found
I was trying to copy a file from parent directory but I am getting error "failed to compute cache key: "/nginx/default" not found: not found"
What I did is COPY ["../nginx/default", "/etc/nginx/sites-enabled"].
Thanks for all the helps
Solution 1:[1]
When you build an image, you have a 'build context' which usually is the directory of where the Dockerfile is. The build context is that directory and all directories below that directory.
For security reasons, a Dockerfile is not allowed to access files outside of the build context.
When you try to go up a directory with '../nginx/default', you move outside the build context, and that's not allowed.
You can either move your nginx config file so it is inside the build context, or you can move the Dockerfile up a level, so you can do
COPY ["./nginx/default", "/etc/nginx/sites-enabled"]
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 |
