Interesting notes on Docker Windows containers

· updated

In this post, I collected some useful links and notes when trying out Docker on Windows with Windows containers.

Useful images

microsoft/aspnet:4.6.2
microsoft/iis
microsoft/windowsservercore

Useful commands

RUN dism /online /enable-feature /all /featurename:iis-webserver /NoRestart
RUN mkdir c:\install 
ADD WebDeploy_2_10_amd64_en-US.msi /install/WebDeploy_2_10_amd64_en-US.msi 
WORKDIR /install 
RUN powershell start-Process msiexec.exe -ArgumentList '/i c:\install\WebDeploy_2_10_amd64_en-US.msi /qn' -Wait
WORKDIR /install
ADD https://download.microsoft.com/download/C/9/E/C9E8180D-4E51-40A6-A9BF-776990D8BCA9/rewrite_amd64.msi rewrite_amd64.msi
RUN Write-Host 'Installing URL Rewrite' ; \
    Start-Process msiexec.exe -ArgumentList '/i', 'rewrite_amd64.msi', '/quiet', '/norestart' -NoNewWindow -Wait

Some notes

  • You do not see the Mount/Disk setting in Docker when using Windows container instead of Linux container because this is not necessary according to the documentation. However, you have to pass in correct parameter for the volume; for instance, C:\data_in_host:C:\data_in_container  or C:/data_in_host:C:/data_in_container  instead of C:/data_in_host:/data_in_container . Check the following links for more information: https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-storage.
  • You cannot test with http://localhost:{host\_port} on Windows. You will have to use either http://{host_name}:{host_port} or http://{container_ip}:{container_port}. To find out container IP, you can use docker inspect –format ‘{{ .NetworkSettings.Networks.nat.IPAddress }}’ container_name.

https://docs.microsoft.com/en-us/virtualization/windowscontainers

https://anthonychu.ca/post/dockerizing-aspnet-4x-windows-containers

https://blog.dudak.me/2015/deploying-aspnet-5-applications-to-docker-containers

Comments

Leave a comment

Comments are moderated. Only your name, website and comment are stored.