Update Ok I figured something out, but I still do not have a solution. This problem seems to only occur on Arch based systems (Antergos, Manjaro, Arch).
If I install a clean system with xfce and docker and dotnet core 2 I can build and run docker images using dotnet core.
After installing VirtualBox, the problem below starts happening, so I suspect it has something to do with some obscure kernel module???
Also uninstaling virtualbox does not fix the problem, only solution is to reinstall Arch fresh, which is a pain. Also it is not possible to run docker and virtualbox on the same system, while trying to develop dotnet core with docker.
End update
I am trying to get dotnet core 2 running with docker, based on microsofts dokumentation (https://github.com/dotnet/dotnet-docker-samples/tree/master/aspnetapp):
My Dockerfile looks like this:
FROM microsoft/aspnetcore-build:2.0.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.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "api.bauernsuche.de.dll"]
I then start the image build process by:
docker build -t bauernsucheapi .
After the build is finished I am trying to start the new image by:
docker run -it --rm -p 5000:80 --name bauernsuche_api bauernsucheapi
Expected: Container running
IS: Error Message: Did you mean to run dotnet SDK commands? Please install dotnet SDK from: http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
Now since I am using the Microsoft Docker iage I would expect the SDK to be available on this. Also my Dockerfile is a straight copy from the Microsoft Example with one change: The Versionnumber was changed from 2.0 to 2.0.0 which seems to be the correct one, since 2.0 gives me errors about not finding an image.
So what am I doing wrong?
My .csproj file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.0" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3742" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta4-build3742" />
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
</ItemGroup>
</Project>
ENTRYPOINT ["dotnet", "api.bauernsuche.de.dll"]toENTRYPOINT ["ls", "-al"]and see what files do you see in the current folder - Tarun Lalwani