The path must be inside the context of the build; you cannot
COPY ../something /something, because the first step of a docker build
is to send the context directory (and subdirectories) to the docker
daemon.
https://docs.docker.com/engine/reference/builder/
dockerfile has the context of its own directory, and its unable to go above.
this issue has a few workarounds, for instance:
run the docker build .
command on the directory you want to be the context, with -f path/to/Dockerfile
another one - if you are using docker-compose, you can pass it a different context, for example, if youre structure goes like:
.
├── docker-compose.yml
└── app
├── Dockerfile
then in your docker-compose file you can give it:
services:
app:
build:
context: .
dockerfile: app/Dockerfile
in this case, the context of the dockerfile will be 1 directory above. but thats seems a bit hacky to me. the correct approach is to put the dockerfile where the files you are trying to copy exists.