dockerfile – docker build requires exactly 1 argument(s)

dockerfile – docker build requires exactly 1 argument(s)

Parameter -f changes the name of the Dockerfile (when its different than regular Dockerfile). It is not for passing the full path to docker build. The path goes as the first argument.

Syntax is:

docker build [PARAMS] PATH

So in your case, this should work:

docker build -f MyDockerfile -t proj:myapp /full/path/to/

or in case you are in the project directory, you just need to use a dot:

docker build -f MyDockerfile -t proj:myapp .

docker build .

DO NOT MISS THE DOT.

dockerfile – docker build requires exactly 1 argument(s)

A. Please upvote Krzysztofs answer. I was lost without his hints.

But B, my contribution.

I was able to use a full path for the –file argument.

docker build --build-arg JAR_FILE=/source/java/mystuff/build/libs/mything-1.0.10-SNAPSHOT.jar --file /full/path/to/MyDockerfile -t proj:myapp .

I had forgotten that little . at the end.

Doh!

Leave a Reply

Your email address will not be published.