‘docker build’ requires exactly 1 argument

Solved2.54K viewsdocker

‘docker build’ requires exactly 1 argument

I am getting this error while building an image from a dockerfile

+ sudo docker build -t test
'docker build' requires exactly 1 argument.
See 'docker build --help'.
 Usage: docker build [OPTIONS] PATH | URL | -
 Build an image from a Dockerfile
Build step 'Execute shell' marked build as failure
Finished: FAILURE'

Share:
vito Edited question June 4, 2021
0

You need to provide the Dockerfile path as well in the command. If your Dockerfile is in the current location and the name is either dockerfile or Dockerfile, then you can provide . at the end of the command.

sudo docker build -t test .

If not, you need to provide the complete path instead of . with -f parameter.

sudo docker build -f path_to_dockerfile/dockerfile_name -t test

Share:
vito Edited answer June 4, 2021

thanks it worked

1
You are viewing 1 out of 1 answers, click here to view all answers.