"docker build" requires exactly 1 argument

Viewed 4156

I just want to build a dockerfile from a different directory, I tried the following command

docker build -f C:/Users/XXXX/XXXX/XXXX/XXXX/XXXX/Dockerfile

and

docker build -f C://Users/XXXX/XXXX/XXXX/XXXX/XXXX/Dockerfile

Both of them yield the same error

"docker build" requires exactly 1 argument.

Am I missing something ?

2 Answers

You should provide the context, current directory for instance: ..

docker build -f C://Users/XXXX/XXXX/XXXX/XXXX/XXXX/Dockerfile -t something .

It is interpreting the C://Users/XXXX/XXXX/XXXX/XXXX/XXXX/Dockerfile in that line as the value for the -f switch (or option)

If you remove that -f it should rather interpret it as the path to the Dockerfile

when i type docker build at the terminal, i see

Usage:  docker build [OPTIONS] PATH | URL | -

im not sure what the -f switch does, but when i build images, I am pretty sure I do this

docker image build -t tagname /path/to/Dockerfile
Related