Public Repository

Last pushed: 5 days ago
Short Description
Internet Information Services (IIS) installed in a Windows Server Core based container
Full Description

IIS Docker Image

Supported tags and respective Dockerfile links

This image is built from the microsoft/iis-docker GitHub repo.

What is IIS?

Internet Information Services (IIS) for Windows® Server is a flexible, secure and manageable Web server for hosting anything on the Web.

How to use this image?

Create a Dockerfile with your website

FROM microsoft/iis

RUN mkdir C:\site

RUN powershell -NoProfile -Command \
    Import-module IISAdministration; \
    New-IISSite -Name "Site" -PhysicalPath C:\site -BindingInformation "*:8000:"

EXPOSE 8000

ADD content/ /site

You can then build and run the Docker image:

$ docker build -t iis-site .
$ docker run -d -p 8000:8000 --name my-running-site iis-site

There is no need to specify an ENTRYPOINT in your Dockerfile since the microsoft/iis base image already includes an entrypoint application that monitors the status of the IIS World Wide Web Publishing Service (W3SVC).

Verify in the browser

With the current release, you can't use http://localhost to browse your site from the container host. This is because of a known behavior in WinNAT, and will be resolved in future. Until that is addressed, you need to use the IP address of the container.

Once the container starts, you'll need to finds its IP address so that you can connect to your running container from a browser. You use the docker inspect command to do that:

docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" my-running-site

You will see an output similar to this:

172.28.103.186

You can connect the running container using the IP address and configured port, http://172.28.103.186:8000 in the example shown.

In addition to static content, IIS can run other workloads including, but limited to ASP.NET, ASP.NET Core, NodeJS, PHP, and Apache Tomcat.

For a comprehensive tutorial on running an ASP.NET app in a container, check out the tutorial on the docs site.

Supported Docker Versions

This image has been tested on Docker Versions 1.12.1-beta26 or higher.

License

MICROSOFT SOFTWARE SUPPLEMENTAL LICENSE TERMS

CONTAINER OS IMAGE

Microsoft Corporation (or based on where you live, one of its affiliates) (referenced as “us,” “we,” or “Microsoft”) licenses this Container OS Image supplement to you (“Supplement”). You are licensed to use this Supplement in conjunction with the underlying host operating system software (“Host Software”) solely to assist running the containers feature in the Host Software. The Host Software license terms apply to your use of the Supplement. You may not use it if you do not have a license for the Host Software. You may use this Supplement with each validly licensed copy of the Host Software.

User Feedback

If you have any issues or concerns, reach out to us through a GitHub issue.

Docker Pull Command
Owner
microsoft

Comments (26)
tuannguyennvg
7 days ago

I run above command and get error:
Sending build context to Docker daemon 22.64 MB
Step 1 : FROM microsoft/iis
latest: Pulling from microsoft/iis

c480435b7cba: Pull complete
2acd7c473906: Extracting [==================================================>] 922.1 MB/922.1 MB
a837699b27ea: Download complete
e4e8167eafc5: Download complete
0344b06e0e62: Download complete
failed to register layer: Error processing tar file(exit status 1): link /Files/Windows/System32/drivers/hvservice.sys /Files/Windows/WinSxS/amd64_microsoft-hyper-v-drivers-hypervisor_31bf3856ad364e35_10.0.14393.576_none_6a09e6b203871d0e/hvservice.sys: no such file or directory
Please help me.
Many thanks

riqitang
19 days ago

Some people commented on issues:

  1. the "unknown blob" issue is caused when your Docker service is set to run Linux containers instead of Windows containers. To fix this, find the docker whale icon in the bottom bar, right-click it, then choose "Switch to Windows containers", then when that's done run the docker build command.
  2. "GetFileAttributesEx content\: The system cannot find the file specified." -- this is because the folder where you put the docker file needs a content directory, just create the directory and add a dummy index.html file that can be a simple as saying "hello world"
husseinsonmez
a month ago

For the ones getting unknown blob error this post might be helpful:
https://forums.docker.com/t/unknown-blob-when-pulling-microsoft-nanoserver/20291/5

navyateja
a month ago

Hi,

I am unable to build Image with the help of following Dockerfile.

FROM microsoft/iis
RUN mkdir C:\site
RUN powershell -NoProfile -Command \
Import-module IISAdministration; \
New-IISSite -Name "Site" -PhysicalPath "C:\site" -BindingInformation "*:8000:"
EXPOSE 8000
ADD content/ /site

It is thowing a error as following.
GetFileAttributesEx content\: The system cannot find the file specified.

Can anyone please help me out?

labdocker
a month ago

Can we use this image to run PHP (FastCGI) on IIS ?

gauravdhamija83
2 months ago

I am also looking for guidance on remotely connecting to IIS running in a docker container....Is there any information on this?

palgy
2 months ago

I got the same issue .

$ docker pull microsoft/iis
Using default tag: latest
latest: Pulling from microsoft/iis

9c7f9c7d9bc2: Downloading
d33fff6043a1: Downloading
b7c3bbe47489: Download complete
1028e286eae2: Download complete
28e6f26ee039: Download complete
unknown blob

mengkzhaoyun
2 months ago

Fails to pull on Windows 10 14946, Docker version 1.12.3-beta30(8536), experimental:

PS C:\Users\admin> docker pull microsoft/iis:nanoserver
nanoserver: Pulling from microsoft/iis

5496abde368a: Downloading
482ab31872a2: Downloading
5b8eb6e071e4: Download complete
f2e35e8a0a9e: Download complete
cdee81240699: Download complete
99fc95dcd261: Download complete
71058a884d2d: Download complete
unknown blob

ilievil
3 months ago

I had the same issue with Windows Server 2016. There were newer images that are not compatible with an older version of docker. I had installed an 1.12.2-cs2-ws-beta-rc1 and after that I install a newer one - the formal 1.12.2-cs2-ws-beta. I deleted the images and pull them again. Hope this will solve your issue :)