0

My docker version is

Docker version 1.12.2-cs2-ws-beta, build 050b611

I am trying to build the image using command

docker build -t iis-dockerfile .

The DockerFile content is

FROM microsoft/iss
RUN echo "Hello World - Dockerfile" > C:\inetpub\wwwroot\index.html

config.json is

{
    "auths": {
        "https://index.docker.io/v1/": {
            "auth": <somekey>
        }
    }
}

On running docker build, it gives error

Sending build context to Docker daemon 2.048 kB
Step 1/2 : FROM microsoft/iss
unauthorized: authentication required

I have already done docker login. That's how config.json is created. I am new to containers and following the get started tutorial https://blogs.msdn.microsoft.com/allthingscontainer/2016/09/15/windows-containers-getting-started-a-step-by-step-guide/. Any idea how can I work around this.

Also I figured out that docker pull is working for me. While this also required authentication

Jitendra
  • 732
  • 1
  • 9
  • 29
  • What is the permission of your docker file? – masud_moni Feb 27 '17 at 07:04
  • "FileSystemRights : FullControl" for all Administrator, user, system – Jitendra Feb 27 '17 at 07:17
  • http://stackoverflow.com/questions/36663742/docker-unauthorized-authentication-required-upon-push-with-successful-login https://github.com/docker/hub-feedback/issues/645 Did you check the above links? They states similar problems. – masud_moni Feb 27 '17 at 07:24
  • 1
    Just an observation. Make sure your docker file has correct base image name. Are you sure you want `FROM microsoft/iss` and not `FROM microsoft/iis`? – Sameer Azazi Feb 27 '17 at 08:26

1 Answers1

3

Just an observation. Make sure your docker file has correct base image name. Are you sure you want FROM microsoft/iss and not FROM microsoft/iis?

When I tried to create new image with correct base image. It seem to work.

Docker docker build -t test-iid .
Sending build context to Docker daemon 344.9 MB
Step 1/2 : FROM microsoft/iis
latest: Pulling from microsoft/iis
3889bb8d808b: Downloading
3430754e4d17: Downloading
7aee39cd34f9: Downloading [>                                                  ]   540 kB/122.7 MB
5b8e6b632025: Download complete
e067d71858d2: Download complete
Sameer Azazi
  • 1,503
  • 10
  • 16