I keep getting the "docker build" requires exactly 1 argument(s) error

I was facing the same issue. I missed the little period ( . ) at the end of the command. I copy pasted the command from official docker docs. The period ( . ) at the end of the command tells Docker to use the shell’s current working directory as the build context. Be sure include the period (.) at the end of the command, and be sure to run the command from the current working directory that contains the Dockerfile and application code.


Docker build requires docker file.

Note: you must provide URL or path where you store your built docker image file. You missed providing the URL or path

SYNTAX: docker image build OPTIONS <url or path>

Solution commands (in 2 ways)

  1. docker image build -f <dockerfile> <url or path>
  2. docker build -f <dockerfile> <url or path>

Eg, docker build --file ./Dockerfile.txt .


Turns out there was some hidden formatting in my command. If I wrote it out manually, instead of copy/pasting, it worked. So I guess the lesson learned here is; check your copying.