1

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
  • 31
  • 1
  • 5

2 Answers2

2

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
  • 31
  • 1
  • 5
  • I'm facing the same issue. Image runs fine on Docker but fails on Kubernetes (with the "Did you meant to run...." error you shared initially. That command you shared was helpful in that it shows me that all my dll's are there as expected. I can then run "dotnet helloworld.dll" and the application runs fine. What did you mean by it wasn't being putting into the container as we thought? Did you meant that it wasn't there at all? – Stephen Dryden Jul 30 '20 at 08:22
  • @StephenDryden I just meant that our application code was not being copied into the container as/where expected – Todd Weber Jul 31 '20 at 14:59
0

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
  • 162
  • 2
  • 5