Invoke-Webrequest causing issues in Dockerfile

0

I've got a Dockerfile like the following:

FROM microsoft/dotnet-framework:4.7
ARG source
WORKDIR /app
COPY ${source:-obj/Docker/publish} .

RUN powershell.exe -Command \
    $ErrorActionPreference = 'Stop'; \
    $ProgressPreference = 'SilentlyContinue'; \
    Invoke-WebRequest -Uri 'http://someexehost.com/some.exe' -OutFile some.exe; \
    Write-Host "Done!";

ENTRYPOINT ["C:\app\myapp.exe"]

I'm using Visual Studio tools for Docker and for some reason the webrequest is causing my container not to start with the following:

1>Step 5/6 : RUN powershell.exe -Command     $ErrorActionPreference = 'Stop';     $ProgressPreference = 'SilentlyContinue';     Invoke-WebRequest -Uri 'http://someexehost.com/some.exe' -OutFile some.exe;     Write-Host "Done!";
1> ---> Running in 63d7138224ae
1>Done!
1> ---> 3d74888328e6
1>Removing intermediate container 63d7138224ae
1>Step 6/6 : ENTRYPOINT ["C:\app\myapp.exe"]
1> ---> Running in 5cde6696f192
1> ---> 886ef5d4cbe0
1>Removing intermediate container 5cde6696f192
1>Successfully built 886ef5d4cbe0
1>Successfully tagged myapp:dev
1>Creating dockercompose3914093320625839864_myapp_1 ...
1>Creating dockercompose3914093320625839864_myapp_1
1>[1A[2K
1>Creating dockercompose3914093320625839864_myapp_1 ... [31merror[0m
1>[1B
1>ERROR: for dockercompose3914093320625839864_myapp_1  Cannot start service myapp: container 16740ff071cd596a22b5b66f9b21f26e2ae9182ceeb1c92a980edc15da5c43d7 encountered an error during Start: failure in a Windows system call: The compute system exited unexpectedly. (0xc0370106)
1>ERROR: for myapp  Cannot start service myapp: container 16740ff071cd596a22b5b66f9b21f26e2ae9182ceeb1c92a980edc15da5c43d7 encountered an error during Start: failure in a Windows system call: The compute system exited unexpectedly. (0xc0370106)
1>Encountered errors while bringing up the project.

The Program.cs file is just a while(true) loop so it's not the app failing to start. If I remove the RUN block then the container starts without a problem. Any ideas?

edit It's worth pointing out that running the same command from a local powershell/cmd window succeeds withouth any issues.

docker
dockerfile
asked on Stack Overflow Nov 14, 2017 by devlife • edited Nov 14, 2017 by devlife

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0