0

The docs say:

docker build [OPTIONS] PATH | URL | -

and

--file , -f     Name of the Dockerfile (Default is 'PATH/Dockerfile')

so I'm using

docker build -t <my tag> -f /path/to/my/Dockerfile>

but I get:

"docker build" requires exactly 1 argument.
See 'docker build --help'.

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

How do the docs need correcting?

Snowcrash
  • 80,579
  • 89
  • 266
  • 376
  • 1
    Does this answer your question? ["docker build" requires exactly 1 argument(s)](https://stackoverflow.com/questions/46517241/docker-build-requires-exactly-1-arguments) – huy Jan 28 '21 at 07:16
  • 3
    You forgot path I think. Add `.` after `build` – Alex Yu Jan 28 '21 at 07:16

1 Answers1

0

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.

vanntile
  • 2,727
  • 4
  • 26
  • 48