Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

616
Vistas
Getting "Did you mean to run dotnet SDK commands? Please install dotnet SDK from"

I am trying to containerize a .net MVC application, but when I run the image am getting the error like below

user@tuser:~/sam/WebApp$ docker run -p 8000:80 sam:latest

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

user@user:~/sam/WebApp$

And my Dockerfile looks like

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
COPY /bin/Release/Publish /app
ENTRYPOINT ["dotnet", "WebApp.dll"]

Where am I going wrong?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Late answer, but pretty common issue so I'll answer it.

This usually happens if the dll targeting argument in your entrypoint doesn't exist. There are other possibilities if you're exporting, tar-ing and reimporting assets, but that's probably not what we're dealing with here.

In your case, the copy operation is pointing at a root relative file location. I assume that you're not publishing to {system root/}bin/Release/Publish, and your dockerfile is located in the root of your project.

To solve this, you should perform copy operations relative to the directory your dockerfile is in, and specify copy operations using a directory relative path (./etc).

Example that works from my testing:

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
COPY ./bin/Release/Publish /app
ENTRYPOINT ["dotnet", "WebApi.dll"]

To see if it works, examine the resulting container by launching with a cmd override:

docker run -it --rm sam:latest /bin/sh
...
pwd #ensure workdir is app
ls -la #ensure that your application is copied here

If you want to investigate deeper, you can use docker run to override your entrypoint and experiment with different launch configurations to see the output. The commands you'll need are as follows:

docker run -it --rm --entrypoint {dotnet executable} {image}:{tag} {non-existent dll}

Example of output when targeting a non-existent dll via override on an otherwise working container:

➜ docker run -it --rm --entrypoint dotnet sam:latest weebles.dll
Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
  https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda