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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…