Error building a docker in Windows 10

1

I'm trying to build a docker image from a really simple project, just to start understanding how docker works and communicate. So, I have created a WebApi project, with just one method that returns a 200.

Once the project has been created, I created the dockerfile:

# TP5 for technology preview (will not be needed when we go GA)
# FROM microsoft/iis
FROM microsoft/iis:TP5

MAINTAINER Roman_Hervas

# Install Chocolatey (tools to automate commandline compiling)
ENV chocolateyUseWindowsCompression='false'
RUN @powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

# Install build tools
RUN powershell add-windowsfeature web-asp-net45 \
&& choco install microsoft-build-tools -y --allow-empty-checksums -version 14.0.23107.10 \
&& choco install dotnet4.6-targetpack --allow-empty-checksums -y \
&& choco install nuget.commandline --allow-empty-checksums -y \
&& nuget install MSBuild.Microsoft.VisualStudio.Web.targets -Version 14.0.0.3 \
&& nuget install WebConfigTransformRunner -Version 1.0.0.1

RUN powershell remove-item C:\inetpub\wwwroot\iisstart.*

# Copy files (temporary work folder)
RUN md c:\build
WORKDIR c:/build
COPY . c:/build

# Restore packages, build, copy
RUN nuget restore \
&& "c:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /p:Platform="Any CPU" /p:VisualStudioVersion=12.0 /p:VSToolsPath=c:\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\tools\VSToolsPath WebApiDocker.sln \
&& xcopy c:\build\WebApiDocker\* c:\inetpub\wwwroot /s

# NOT NEEDED ANYMORE –> ENTRYPOINT powershell .\InitializeContainer

And the InitializeContainer:

If (Test-Path Env:\ASPNET_ENVIRONMENT)
{
    \WebConfigTransformRunner.1.0.0.1\Tools\WebConfigTransformRunner.exe \inetpub\wwwroot\Web.config "\inetpub\wwwroot\Web.$env:ASPNET_ENVIRONMENT.config" \inetpub\wwwroot\Web.config
}

# prevent container from exiting
powershell

So, finally, I try to execute the command to build the project: docker build -t dockerexample .

The result is a failure with the following message (step 4):

Step 1/10 : FROM microsoft/iis:TP5 
---> accd044753c1

Step 2/10 : MAINTAINER Roman_Hervas
 ---> Using cache
 ---> e42af9c57e0d

Step 3/10 : ENV chocolateyUseWindowsCompression 'false'
 ---> Using cache
 ---> 24621a9f18d9

Step 4/10 : RUN @powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((New-Object System.Net.WebClient).D
ownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
 ---> Running in 61199189917a
container 61199189917a0057fb54dddca6d80a6c6f9e8b77d2326379537684f58fefbe50 encountered an error during CreateContainer:
failure in a Windows system call: A connection could not be established with the Virtual Machine hosting the Container.
(0xc0370108) extra info: {"SystemType":"Container","Name":"61199189917a0057fb54dddca6d80a6c6f9e8b77d2326379537684f58fefb
e50","Owner":"docker","IsDummy":false,"IgnoreFlushesDuringBoot":true,"LayerFolderPath":"C:\\ProgramData\\Docker\\windows
filter\\61199189917a0057fb54dddca6d80a6c6f9e8b77d2326379537684f58fefbe50","Layers":[{"ID":"08b847bd-7f7e-5758-90be-43262
e170e22","Path":"C:\\ProgramData\\Docker\\windowsfilter\\64e43de6efd9eee001b12f6ed8add83d1aefff6cb5f8b55e9a44c4b1b2f27b8
0"},{"ID":"293472e6-599f-5a8e-b531-ac7499b0c900","Path":"C:\\ProgramData\\Docker\\windowsfilter\\cfb71fcbe2f95caa2a5306d
800c3d649067c00702a26a208ead6f5fed58e49c8"},{"ID":"baacc247-5374-5761-812f-e1ad911fda31","Path":"C:\\ProgramData\\Docker
\\windowsfilter\\89144a071d22e130e0ca9a069857a181b8976e9557c95395fb58116358dd5a02"},{"ID":"3d538ae4-eaf0-574c-b274-30bba
ce1a9b0","Path":"C:\\ProgramData\\Docker\\windowsfilter\\e2ff3bea019eaee94ab33312b6a39d6305b85df9b0b950680aa38e55eec5437
1"},{"ID":"937e8340-c320-5f09-a87e-9cd5912f40bb","Path":"C:\\ProgramData\\Docker\\windowsfilter\\0dd23a484fe7eea9da274be
8e6e1f0768b52a8a121e7bf274d5974ada02400d8"}],"HostName":"2ac70997c0f2","MappedDirectories":[],"SandboxPath":"C:\\Program
Data\\Docker\\windowsfilter","HvPartition":true,"EndpointList":["deb85df1-5dba-4394-a1ac-77f4a106e31a"],"HvRuntime":{"Im
agePath":"C:\\ProgramData\\Docker\\windowsfilter\\0dd23a484fe7eea9da274be8e6e1f0768b52a8a121e7bf274d5974ada02400d8\\Util
ityVM"},"Servicing":false,"AllowUnqualifiedDNSQuery":true}

I'm totally noob with Docker, so I have no idea of the problem here, and Google has not been too much helpful. My operating system is Windows 10 Pro, and Docker version is 17.03.1-ce-win12 (12058).

Question: Why is it launching an error in step 4?

Thank you very much in advance.

docker
windows-10
dockerfile
asked on Stack Overflow Jun 14, 2017 by DarthRoman

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0