Closed FerAguilarR93 closed 5 years ago
Can you please share steps to reproduce this?
I have added some steps to reproduce the problem if more information is needed. Please, tell me and thank you for your help.
Can you share your dockerfile? My guess is that you need to update it manually to include the new project you added in step 3.
this is my dockerfile:
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY ["MicroserviceAdvanFuelInterfaces/MicroserviceAdvanFuelInterfaces.csproj", "MicroserviceAdvanFuelInterfaces/"]
RUN dotnet restore "MicroserviceAdvanFuelInterfaces/MicroserviceAdvanFuelInterfaces.csproj"
COPY . .
WORKDIR "/src/MicroserviceAdvanFuelInterfaces"
RUN dotnet build "MicroserviceAdvanFuelInterfaces.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "MicroserviceAdvanFuelInterfaces.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "MicroserviceAdvanFuelInterfaces.dll"]
COPY ["MicroserviceAdvanFuelInterfaces/MicroserviceAdvanFuelInterfaces.csproj", "MicroserviceAdvanFuelInterfaces/"]
+ COPY ["AdvanFuelInterfacesDao/AdvanFuelInterfacesDao.csproj", "AdvanFuelInterfacesDao/"]
+ COPY ["AdvanFuelInterfacesBusiness/AdvanFuelInterfacesBusiness.csproj", "AdvanFuelInterfacesBusiness/"]
RUN dotnet restore "MicroserviceAdvanFuelInterfaces/MicroserviceAdvanFuelInterfaces.csproj"
That's for the class library under the same solution but still I have the problem, I try to add my AdvanCoreApiBusiness.csproj but Docker can't find it because this is in another solution
Sounds like you need to move your projects so they are in the same solution. This is a requirement to have the same projects in a single Docker build context.
It sounds to me like you're running into problems using Docker, specifically, in understanding how the Docker build context works. I'm going to close as there doesn't appear to be any issues with the ASP.NET Core, but rather, with how you have setup your projects. There isn't any actionable item here for the ASP.NET Core docker images, but feel free to continue discussion if you have more questions about how Docker works. You may also try using other forums like Stack Overflow or https://developercommunity.visualstudio.com.
Describe the bug
Hello, I have a problem with visual studio 2017 and docker on release mode, I don't know what's the problem but when I run the project in debug mode all works ok, but on release mode VS can´t create docker image of my project I'm working with: 1° visual studio 2017 version 15.9.3 2° Docker Version 2.0.0.0-win81 (29211)
Steps to reproduce the issue
1° Create a solutuion with a class library with .net core 2.1 2° Create a second solution with an ASP .NET CORE WebApplication(asp .net core 2.1) with docker and https compatibility 3° Add the class library to webapp(class library is added as assembly) 4° Compile webapp(compile succesfully without errors) 5° Run WebApp in release mode (can't generate a docker image)
The output says that can't create docker image because dependency is missing, my docker file is by default I haven't modified it.
here is my output:
this only occurs on release mode but it works on debug mode any idea on how to solve this?... thanks in advance.