0

I have a .Net 4.7.2 application that I am trying to run in a Container Instance in Azure. When built and launched locally, it works just fine. When deployed though, it fails to start. I have no logs (at least, not any that I know exist). This is my docker file:

 # escape=`

ARG REPO=mcr.microsoft.com/dotnet/framework/runtime
FROM $REPO:4.7.2-windowsservercore-ltsc2019

# Install .NET 4.7.2
RUN powershell -Command `
        $ProgressPreference = 'SilentlyContinue'; `
        Invoke-WebRequest `
            -UseBasicParsing `
            -Uri "https://download.microsoft.com/download/6/E/4/6E48E8AB-DC00-419E-9704-06DD46E5F81D/NDP472-KB4054530-x86-x64-AllOS-ENU.exe" `
            -OutFile dotnet-framework-installer.exe `
    && start /w .\dotnet-framework-installer.exe /q `
    && del .\dotnet-framework-installer.exe `
    && powershell Remove-Item -Force -Recurse ${Env:TEMP}\*

# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]

# Download the Build Tools bootstrapper.
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe

# Install Build Tools with the Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues.
RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
    --installPath C:\BuildTools `
    --add Microsoft.VisualStudio.Workload.AzureBuildTools `
    --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
    --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
    --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
    --remove Microsoft.VisualStudio.Component.Windows81SDK `
 || IF "%ERRORLEVEL%"=="3010" EXIT 0

# Copy everything and build app
COPY . C:\Build
RUN "C:/BuildTools/MSBuild/Current/Bin/MSBuild.exe C:/Build/src/App.sln"

ENTRYPOINT cd C:/Build/build/bin/ && App.exe -m 1234 -v ./Files -s config.txt -n 10 -l 0 -t 4

I am stumped. I have no idea where to even begin because there are no logs. Any help would be great.

Thanks,

devza
  • 151
  • 1
  • 6

2 Answers2

0

I'm sure if you change the internal directory of the container, you can succeed.

C:\TEMP\vs_buildtools.exe to C:\vs_buildtools.exe
  • Thanks for your response. There is no issue with the build however, the issue is with the launching of the exe. I have the same result when I just put the binaries in the container. – devza Apr 02 '20 at 23:33
0

From the error you said, it seems you use the wrong character in the Windows OS. It's different in Windows OS from Linux. In Windows, you need to use the \ for the path. Take a look at the example in Dockerfile for the Windows path.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39