I've created an ASP.NET Core 2.1 app that I'm trying to deploy to Google Cloud Platform. It builds just fine using dotnet build
locally.
I cannot build it through Google Cloud Shell, though. Running dotnet --version
confirms the Google Cloud Shell has .NET Core 2.0 installed.
Running gcloud app deploy
initiates a deployment of the app, but I receive a cryptic error from the log saying:
Step #0: Status: Downloaded newer image for gcr.io/gcp-runtimes/aspnetcorebuild@sha256:ad1b788a9b4cca75bb61eb523ef358ca059c4bd208fba15a10ccc6acab83f49a
Step #0: No .deps.json file found for the app Finished Step #0
ERROR: build step 0 "gcr.io/gcp-runtimes/aspnetcorebuild@sha256:ad1b788a9b4cca75bb61eb523ef358ca059c4bd208fba15a10ccc6acab83f49a" failed: exit status 1
I was under the impression that GCP supports .NET Core 2.1 containers by default, so I haven't included a Dockerfile.
I'm trying to deploy to the flexible environment, here's my app.yaml
file:
runtime: aspnetcore
env: flex
Do I need to create a custom Docker container? Or is there some other way to get support for .NET Core 2.1 in Google Cloud Shell?
Edit: For now I've installed Google Cloud Tools to run gcloud app deploy
in a shell locally after running dotnet publish
.
I tried to reproduce it - indeed, Cloud Shell supports .NET Core 2.0 only. I've raised that with the right engineers so Cloud Shell image is updated to support .NET Core 2.1.
In the meantime: