Search code examples
kubernetesazure-container-service

aspnetcore:2.0 based image won't run on AKS nodes?


I have an asp.net core 2.0 application whose docker image runs fine locally, but when that same image is deployed to an AKS cluster, the pods have a status of CrashLoopBackOff and the pod log shows:

Did you mean to run dotnet SDK commands? Please install dotnet SDK from: http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409.

And since you can't ssh to AKS clusters, it's pretty difficult to figure this out?

Dockerfile:

FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY . .
EXPOSE 80
ENTRYPOINT ["dotnet", "myapi.dll"]

Solution

  • Turned out that our build system wasn't putting the app code into the container as we thought. Since the container wasn't runnable, I didn't know how to inspect its contents until I found this command which is a lifesaver for these kinds of situations:

    docker run --rm -it --entrypoint=/bin/bash [image_id]

    ... which at this point, you can freely inspect/verify the contents of the container.