As mentioned in the comments, -f
doesn't set the path to the Dockerfile, but the name of the file used as a Dockerfile. you would need to do something like
docker build -t <tag> <path to the folder of the Dockerfile named X> -f X
More details, as mentioned, here.