Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

First of, I am trying to follow along with this guide.

So far I have the host up and running, but I am stuck at this one point. I've installed the windowsservercore image, and I installed the IIS image and tagged it 'windowsserveriis'. Now I need to install ASP.NET 4.5, and I use the following command

docker build –t windowsserveriisaspnet .

I should maybe add that I create a folder for my Docker images. So I have a C:\dev\TestProject\DockerImages and the a folder for each Dockerfile. Now, I am a bit unsure about this, as the guide never mentions how to actually create the files, so I thought I would divide them up just to be safe (and also be able to have them be named just 'Dockerfile' to avoid confusion).

Anyways, the above command prints out the following error message:

docker : "docker build" requires exactly 1 argument(s).

At line:1 char:1

docker build –t windowsserveriisaspnet .

My Dockerfile looks like this:

FROM windowsserveriis

RUN dism /online /enable-feature /featurename:IIS-ASPNET45

My initial thought was that i forgot the dot at the end, but that is not the case. I also tried replacing the dot with '--file="DockerfileASPNET"' (where I renamed the file). However nothing seems to work.

So, what am I missing? Thanks in advance..

like image 520
Kasper Avatar asked Dec 20 '16 19:12

Kasper


1 Answers

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.

like image 91
Mohsin Latif Avatar answered Sep 19 '22 03:09

Mohsin Latif