Добрый день.
Недавно перенес проект в Docker Compose.
И из-за этого возникли проблемы с миграциями.
Я добавил в контейнер проекта C#, dotnet-ef.
И при вводе команды: dotnet ef migrations add Наименование_Миграции -p ../Проект с Context
Выводится ошибка.
При вводе команды: dotnet build
Ошибка:
При этом построение самого проекта, через IDE идёт отлично без ошибок.
Текст Dockerfile:
FROM mcr.microsoft.com/dotnet/sdk:latest AS build
WORKDIR /src
COPY ["NightPatrol.Core/NightPatrol.Core.csproj", "NightPatrol.Core/"]
COPY ["NightPatrol.Common/NightPatrol.Common.csproj", "NightPatrol.Common/"]
COPY ["NightPatrol.Infrastructure.BotConfiguration/NightPatrol.Infrastructure.BotConfiguration.csproj", "NightPatrol.Infrastructure.BotConfiguration/"]
COPY ["NightPatrol.Services.Interfaces/NightPatrol.Services.Interfaces.csproj", "NightPatrol.Services.Interfaces/"]
COPY ["NightPatrol.Domain.Core/NightPatrol.Domain.Core.csproj", "NightPatrol.Domain.Core/"]
COPY ["NightPatrol.Domain.Interface/NightPatrol.Domain.Interface.csproj", "NightPatrol.Domain.Interface/"]
COPY ["NightPatrol.Infrastructure.Business/NightPatrol.Infrastructure.Business.csproj", "NightPatrol.Infrastructure.Business/"]
COPY ["NightPatrol.Infrastructure.RabbitMq.Send/NightPatrol.Infrastructure.RabbitMq.Send.csproj", "NightPatrol.Infrastructure.RabbitMq.Send/"]
COPY ["NightPatrol.Infrastructure.Data/NightPatrol.Infrastructure.Data.csproj", "NightPatrol.Infrastructure.Data/"]
COPY ["NightPatrol.Infrastructure.RabbitMq.Listener/NightPatrol.Infrastructure.RabbitMq.Listener.csproj", "NightPatrol.Infrastructure.RabbitMq.Listener/"]
RUN dotnet tool install -g dotnet-ef
RUN dotnet restore "NightPatrol.Core/NightPatrol.Core.csproj"
COPY . .
WORKDIR "/src/NightPatrol.Core"
RUN dotnet build "NightPatrol.Core.csproj" -c Debug -o /app/build
FROM build AS publish
RUN dotnet publish "NightPatrol.Core.csproj" -c Debug -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "NightPatrol.Core.dll"]