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

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 workingdirectory as the build context.Be sure include the period (.) at the end of the command, and be sure to run thecommand 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 .


I have also faced the same issue when I copy pasted the given command. However, it worked when I typed the same command given below.

$ docker image build -t python-hello-world .