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

11/17/2017

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"]
-- Todd Weber
azure-container-service
kubernetes

2 Answers

12/14/2017

I just ran into the same issue and it's because I was missing a key piece to the puzzle.

docker-compose -f docker-compose.ci.build.yml run ci-build

VS2017 Docker Tools will create that docker-compose.ci.build.yml file. After that command is run, the publish folder is populated and docker build -t <tag> will build a populated image (without an empty /app folder).

-- ryanmcdonnell
Source: StackOverflow

11/20/2017

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.

-- Todd Weber
Source: StackOverflow