I have create default VS2017 webAPI project with docker support for Linux. When i had try to build image I met problem like "unable to find .../docker-buildxxxx/" , to solve it i moved dockerfile on one level up, where is *.sln and .dockerignore file are.
I had successfully build and run that image, but i have no luck to take some request into container. I use -p host_port:container_port in all possible combinations, but it is useless.
FYI: without docker it works fine. (dotnet test.dll)
Can you provide some point where i have to research or can you provide exact solution ?
docker version
Client: Docker Engine - Community
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:47:51 2018
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:52:55 2018
OS/Arch: linux/amd64
Experimental: false
docker run -t service --port 8080:80 --name myfirst_container
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {71f5b198-2cbb-45ba-a7fc-a36df9f8b985} may be persisted to storage in unencrypted form.
Hosting environment: Production
Content root path: /app
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.
DOCKERFILE
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY ["test/test.csproj", "test/"]
RUN dotnet restore "test/test.csproj"
COPY . .
WORKDIR "/src/test"
RUN dotnet build "test.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "test.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "test.dll"]