我正在尝试将aspnetcore webapi停靠。我按照这里的教程: https://docs.docker.com/engine/examples/dotnetcore/
但是当我运行我的容器时,我有这样的信息:
Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
我下载代码并从Dockerfile构建映像github站点:
https://github.com/dotnet/dotnet-docker-samples/tree/master/aspnetapp
我运行容器......它有效...我比较了两个Dockerfile,它们非常相似:
矿:
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"]
来自github样本的那个:
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"]
如果缺少信息,请告诉我,我会添加它。谢谢!
答案 0 :(得分:1)
尝试删除RUN ln -s fnizz.webapi.dll entrypoint.dll
并将您的ENTRYPOINT更改为ENTRYPOINT [ "dotnet", "entrypoint.dll" ]
。我相信dotnet
可能在DLL扩展上很有用。此模式还允许您对程序集名称进行泛化 - 有时很有用。