2

I'm trying to dockerize a aspnetcore webapi. I followed the tutorial here: https://docs.docker.com/engine/examples/dotnetcore/

But when I run my container I have this message:

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

I download the code and build the image from the Dockerfile the github site:

https://github.com/dotnet/dotnet-docker-samples/tree/master/aspnetapp

I run the container... and it works... I compared two Dockerfile and they are very similar:

Mine:

FROM microsoft/aspnetcore-build:2.0.5-2.1.4 AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

# Build runtime image
FROM microsoft/aspnetcore:2.0.5
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "fnizz.webapi.dll"]

And the one from the github sample:

FROM microsoft/aspnetcore-build:2.0 AS build-env
WORKDIR /app

# copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

# copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

# build runtime image
FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "aspnetapp.dll"]

If there is missing info, tell me, I'll add it. Thank you !

4
  • i believe youd get that error if it didn't see your dll in there; and ive had other weirdness with dll names, e.g it might see .webapi.dll as the extension Commented Feb 15, 2018 at 16:55
  • Thank you I try... we never know ;) Commented Feb 15, 2018 at 17:00
  • my answer pitch would be an easier experiment than proj rename Commented Feb 15, 2018 at 17:01
  • Ok, I will try your answer... it was just to test and it was that !!! Commented Feb 15, 2018 at 17:05

1 Answer 1

1

Try dropping a RUN ln -s fnizz.webapi.dll entrypoint.dll and changing your ENTRYPOINT to ENTRYPOINT [ "dotnet", "entrypoint.dll" ]. I believe dotnet might be finnicky on DLL extensions. This pattern also lets you genericize the assembly name -- sometimes useful.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.