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

4

1 回答 1

3

只是一个观察。确保您的 docker 文件具有正确的基本映像名称。你确定你想要FROM microsoft/iss而不是FROM microsoft/iis

当我尝试使用正确的基础图像创建新图像时。它似乎工作。

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
于 2017-02-27T08:29:39.597 回答