【发布时间】:2020-04-07 09:37:18
【问题描述】:
我有一个 .Net 4.7.2 应用程序,我试图在 Azure 的容器实例中运行它。在本地构建和启动时,它工作得很好。但是,在部署时,它无法启动。我没有日志(至少,没有我知道存在的任何日志)。这是我的 docker 文件:
# 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
我被难住了。我什至不知道从哪里开始,因为没有日志。任何帮助都会很棒。
谢谢,
【问题讨论】:
-
你得到什么错误?
-
@CharlesXu 我没有收到错误:/ 这就是问题
-
还有问题吗?它解决了你的问题吗?如果它对你有用,请接受它。我没有看到任何更新。你还在处理这个问题吗?
标签: azure docker azure-container-instances