I have a Docker recipe to run a server for .NET Core 3.1 and SQL Server. The recipe is:
Dockerfile
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 as base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
COPY ["ExampleProject.csproj", "./"]
RUN dotnet restore "./ExampleProject"
COPY . .
RUN dotnet build "ExampleProject" -c Release -o /app
FROM build as publish
RUN dotnet publish "ExampleProject" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ExampleProject"]
docker-compose.yml
version: "3"
services:
web:
build: .
ports:
- "8000:80"
depends_on:
- db
db:
image: "mcr.microsoft.com/mssql/server"
environment:
SA_PASSWORD: "Jko3va-D9821jhsvGD"
ACCEPT_EULA: "Y"
When I try to run this Docker instance, I get the follow error when building the SQL Server.
An error occurred while migrating the database.
web_1 | Microsoft.Data.SqlClient.SqlException (0x80131904): Option 'SINGLE_USER' cannot be set in database 'master'.
User contributions licensed under CC BY-SA 3.0