I have asp.net core solution, that contains 3 projects.
I want to deploy it to the docker container.
Here is how the solution looks like
Here is my Dockerfile
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 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 mcr.microsoft.com/dotnet/core/aspnet:2.2
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "tooseeweb.dll"]
But when I run docker build I got this in console
Skipping project "/TooSeeWeb.Core/TooSeeWeb.Core.csproj" because it was not found.
Skipping project "/TooSeeWeb.Infrastructure/TooSeeWeb.Infrastructure.csproj" because it was not found.
MSBUILD : error MSB1009: Project file does not exist. Switch: TooSeeWeb.csproj
Error: ResponseItem.ErrorDetail[code=1,message=The command '/bin/sh -c dotnet build "TooSeeWeb.csproj" -c Release -o /app' returned a non-zero code: 1] Failed to deploy ' Dockerfile: TooSeeWeb/Dockerfile': The command '/bin/sh -c dotnet build "TooSeeWeb.csproj" -c Release -o /app' returned a non-zero code: 1
Where can be a problem?
UPDATE
Structure of folders of my solution
TooSeeWeb
|- aspnet-core(folder)
|-TooSeeWeb (folder)
|- TooSeeWeb.sln
|- TooSeeWeb
|-Dockerfile
|- TooSeeWeb.csproj
|- TooSeeWeb.Core(folder)
|- TooSeeWeb.Core.csproj
|- TooSeeWeb.Infrastructure(folder)
|- TooSeeWeb.Infrastructure.csproj
UPDATE2
I move dockerfile in the same folder with sln (it's one folder up)
Now my docker file looks like this
ROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.sln ./
COPY TooSeeWeb/*.csproj ./TooSeeWeb/
COPY TooSeeWeb.Core/*.csproj ./TooSeeWeb.Core/
COPY TooSeeWeb.Infrastructure/.*csproj ./TooSeeWeb.Infrastructure/
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
WORKDIR /app/TooSeeWeb
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "tooseeweb.dll"]
But I got error
Step 4/14 : COPY *.sln ./ COPY failed: no source files were specified
