@EternalKiller

Проблема с docker compose read-only file system?

Добрый день.
Недавно перенес проект в Docker Compose.
И из-за этого возникли проблемы с миграциями.
Я добавил в контейнер проекта C#, dotnet-ef.
И при вводе команды: dotnet ef migrations add Наименование_Миграции -p ../Проект с Context
Выводится ошибка.
63a93ef1d2644258408696.png
При вводе команды: dotnet build
Ошибка:
63a93f18209f8941748643.png

При этом построение самого проекта, через 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"]
  • Вопрос задан
  • 76 просмотров
Решения вопроса 1
@EternalKiller Автор вопроса
Исправил, просто добавив в команду dotnet ef migrations add Наименование_Миграции -p ../Проект
Параметр --no-build
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы