Windows docker映像构建在创建目录时挂起

时间:2017-02-08 15:47:08

标签: asp.net docker windows-container

我跟随instructions given by Microsoft为ASP.Net应用程序创建了一个Windows docker镜像但由于某种原因它无法通过mkdir步骤。

这是dockerfile:

FROM microsoft/aspnet

RUN mkdir C:\storefront

RUN powershell -NoProfile -Command \
    Import-module IISAdministration; \
    New-IISSite -Name "Storefront" -PhysicalPath C:\storefront -BindingInformation "*:80:"

EXPOSE 80

ADD storefront/ /storefront

以下是我得到的输出:

docker build -t storefront .
Sending build context to Docker daemon 137.8 MB
Step 1/5 : FROM microsoft/aspnet
 ---> e761eca2f8df
Step 2/5 : RUN mkdir C:\storefront
 ---> Running in a939dd7163b1

它只是挂在mkdir上。

我已经尝试过使用md,将反斜杠更改为斜杠,并使用相对路径而不是驱动器号,所有这些都会导致同样的事情发生。

修改

这里是构建的日志输出:

[12:22:10.718][ApiProxy       ][Info   ] proxy >> GET /_ping
[12:22:10.718][ApiProxy       ][Info   ] Dial name pipe  \\.\pipe\docker_engine_windows
[12:22:10.718][ApiProxy       ][Info   ] Successfully dialed name pipe \\.\pipe\docker_engine_windows
[12:22:10.718][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:10.718369300-05:00" level=debug msg="Calling GET /_ping" 
[12:22:10.718][ApiProxy       ][Info   ] proxy << GET /_ping
[12:22:11.106][ApiProxy       ][Info   ] proxy >> POST /v1.25/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=storefront&ulimits=null
[12:22:11.106][ApiProxy       ][Info   ] Dial name pipe  \\.\pipe\docker_engine_windows
[12:22:11.106][ApiProxy       ][Info   ] Successfully dialed name pipe \\.\pipe\docker_engine_windows
[12:22:11.106][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:11.106869500-05:00" level=debug msg="Calling POST /v1.25/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&    networkmode=default&rm=1&shmsize=0&t=storefront&ulimits=null" 
[12:22:34.138][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.138382000-05:00" level=debug msg="[BUILDER] Cache miss: [cmd /S /C mkdir C:\\storefront]" 
[12:22:34.138][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.138382000-05:00" level=debug msg="[BUILDER] Command to be executed: [cmd /S /C mkdir C:\\storefront]" 
[12:22:34.140][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.140380500-05:00" level=debug msg="hcsshim::GetLayerMountPath Flavour 1 ID 8aa6a1776a6803a692f68e8ac6da9c5edcb38cfcdf2edd75c5706442323e7f5b" 
[12:22:34.140][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.140380500-05:00" level=debug msg="Calling proc (1)" 
[12:22:34.140][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.140380500-05:00" level=debug msg="Calling proc (2)" 
[12:22:34.140][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.140380500-05:00" level=debug msg="hcsshim::GetLayerMountPath succeeded flavour=1 id=8aa6a1776a6803a692f68e8ac6da9c5edcb38cfcdf2edd75c5706442323e7f5b     path=C:\\ProgramData\\Docker\\windowsfilter\\8aa6a1776a6803a692f68e8ac6da9c5edcb38cfcdf2edd75c5706442323e7f5b" 
[12:22:34.140][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.140380500-05:00" level=debug msg="hcsshim::CreateSandboxLayer layerId 6c84bcad548f6d4b74239e882e156d7a9dffa2b38842393b237b8c4470364f2c parentId     C:\\ProgramData\\Docker\\windowsfilter\\8aa6a1776a6803a692f68e8ac6da9c5edcb38cfcdf2edd75c5706442323e7f5b" 
[12:22:34.140][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.140380500-05:00" level=debug msg="hcsshim::NameToGuid Name 8aa6a1776a6803a692f68e8ac6da9c5edcb38cfcdf2edd75c5706442323e7f5b" 
[12:22:34.140][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.140380500-05:00" level=debug msg="hcsshim::NameToGuid Name 4bbfe8c329c52aca77b41bf0c3c7673ca55232f3520a74dacd3befa4ffa7a161" 
[12:22:34.140][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.140380500-05:00" level=debug msg="hcsshim::NameToGuid Name 6f7c5ba7066e3999eadcb8c7ce0ce997cf65a748f15755557b2bc3dd79d2e8cc" 
[12:22:34.140][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.140380500-05:00" level=debug msg="hcsshim::NameToGuid Name 4d9fc7ac017392ffdd91d3b2efe1bce1cadcab146692490e8c9300747be6ce40" 
[12:22:34.141][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.140380500-05:00" level=debug msg="hcsshim::NameToGuid Name 3fc2c39416c9725cedc3e74e11d53a63338a00ec33c968657b2724cdd0da9b4a" 
[12:22:34.141][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.141380400-05:00" level=debug msg="hcsshim::NameToGuid Name 70d596762a12ad5312e4594bd5d1670ee886d76d356a464a22b9fa648ab42bf9" 
[12:22:34.147][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.147380700-05:00" level=debug msg="hcsshim::CreateSandboxLayer - succeeded layerId=6c84bcad548f6d4b74239e882e156d7a9dffa2b38842393b237b8c4470364f2c     parentId=C:\\ProgramData\\Docker\\windowsfilter\\8aa6a1776a6803a692f68e8ac6da9c5edcb38cfcdf2edd75c5706442323e7f5b" 
[12:22:34.211][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.211976300-05:00" level=debug msg="Assigning addresses for endpoint condescending_fermi's interface on network nat" 
[12:22:34.211][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.211976300-05:00" level=debug msg="RequestAddress(172.25.112.0/20, <nil>, map[])" 
[12:22:34.211][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.211976300-05:00" level=debug msg="attach: stdout: begin" 
[12:22:34.211][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:34.211976300-05:00" level=debug msg="attach: stderr: begin" 
[12:22:49.531][ApiProxy       ][Info   ] Cancel connection...
[12:22:49.531][WindowsDockerDaemon][Info   ] time="2017-02-08T12:22:49.531681200-05:00" level=debug msg="Build cancelled, killing and removing container: 6c84bcad548f6d4b74239e882e156d7a9dffa2b38842393b237b8c4470364f2c" 

1 个答案:

答案 0 :(得分:0)

安装最新的Windows更新和新版本的Docker解决了这个问题。