Error building a docker in Windows 10

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:

  • Monitoring a log file for systemd service startup
  • Sorl4 failing to index when using EBS volume in ECS
  • Where should live docker volumes on the host?
  • Mounting container volume from the hosts' drive?
  • How long will kube-controller-manager migrate one pod from a shutdown node to another health node
  • Difference between Rancher and other container orchestration
  • # 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 dependency issue: Rake aborted! LoadError: cannot load such file — sqlite3/sqlite3_native
  • docker pull behind shadowsocks proxy
  • Centos docker container crashes with 6 Segmentation fault - where's the core dump
  • Configuring application in docker container to access other containers
  • Profiling Java application in kubernetes
  • How could I launch multiple container at a time shared one Dockerfile
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.