Docker镜像无法在单个容器实例上启动,但在DockerHub上可以正常工作
我们的项目具有在Windows上构建的docker映像,该映像已推送到Azure容器注册表和DockerHub。
有两种应用程序服务-一种引用来自DockerHub(公共仓库)的容器映像,另一种引用来自ACR的同一映像-单个容器实例。
从DockerHub部署的一个启动并运行时没有任何错误消息,而部署到“单个容器实例”的一个则在日志中引发以下错误:
1/07/2019 23:36:51.227 INFO - Site: mycontainer - Start container succeeded. Container:
11/07/2019 23:36:56.245 INFO - Site: mycontainer - Container has exited
11/07/2019 23:36:56.261 INFO - Site: mycontainer - Purging pending logs after stopping container
11/07/2019 23:36:56.245 ERROR - Site: mycontainer - Container could not be started
11/07/2019 23:36:56.245 INFO - Site: mycontainer - Attempting to stop container: 196bc2a89fb093415220b659c1eda7fabaaeebd97a2e71802e1dce592defcb35
11/07/2019 23:36:56.261 INFO - Site: mycontainer - Container stopped successfully. Container Id: 196bc2a89fb093415220b659c1eda7fabaaeebd97a2e71802e1dce592defcb35
11/07/2019 23:36:56.274 INFO - Site: mycontainer - Purging after container failed to start
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-nanoserver-1809 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-nanoserver-1809 AS build
WORKDIR /src
COPY ["ProjectFolder/ContainerProject.csproj", "ProjectFolder/"]
RUN dotnet restore ProjectFolder/ContainerProject.csproj
COPY . .
WORKDIR "/src/ProjectFolder"
RUN dotnet build "ContainerProject.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "ContainerProject.csproj" -c Release -o
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ContainerProject.dll"]
由于Windows容器不提供“诊断和解决问题”选项,如果有人遇到类似情况以及是否有任何修复/故障排除步骤,请提供帮助。
谢谢!