我正在尝试在谷歌应用引擎上部署 .net 核心应用。远程构建输出卡在
Updating service [default]...failed. ERROR: (gcloud.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
5分钟左右后。这是第一次部署。
在检查日志时发现一行表示为
Application startup error ...Did you mean to run dotnet SDK commands? Please install dotnet SDK from ...link
.
较早的 Dockerfile 有以下配置
FROM microsoft/dotnet:1.1.0-runtime
COPY . /app
WORKDIR /app
EXPOSE 8080/tcp
ENV ASPNETCORE_URLS http://*:8080
ENTRYPOINT ["dotnet", "actualdllname.dll"]
.
基于此更改的 Dockerfile 添加以下附加行:
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install .NET Core
ENV DOTNET_VERSION 1.1.0
ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/release/1.1.0/Binaries/$DOTNET_VERSION/dotnet-debian-x64.$DOTNET_VERSION.tar.gz
RUN curl -SL $DOTNET_DOWNLOAD_URL --output dotnet.tar.gz \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -sfn /usr/share/dotnet/dotnet /usr/bin/dotnet
该脚本在gcloud app deploy
.
仍然无法解决错误。