I can't put PostgreSQL in Docker Compose. The project on ASP.NET MVC. IDE - Visual Studio 2022
10:30 22 Nov 2025

Dockerfile:

FROM mcr.microsoft.com/dotnet/aspnet:8.0-nanoserver-1809 AS base
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-1809 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Booking_PP/Booking_PP.csproj", "Booking_PP/"]
RUN dotnet restore "./Booking_PP/Booking_PP.csproj"
COPY . .
WORKDIR "/src/Booking_PP"
RUN dotnet build "./Booking_PP.csproj" -c %BUILD_CONFIGURATION% -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Booking_PP.csproj" -c %BUILD_CONFIGURATION% -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Booking_PP.dll"]

docker-compose.yml:

services:
  bd_booking_pp:
    image: postgres:latest
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: 3115
    volumes:
      - booking_pp-data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
  
  booking_pp:
    image: ${DOCKER_REGISTRY-}bookingpp
    build:
      context: .
      dockerfile: Booking_PP\Dockerfile
    ports:
      - "8080:8080"
      - "8081:8081"
    depends_on:
      - bd_booking_pp
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ConnectionStrings__BD_Booking_PPConnectionString=Host=localhost;Database=BD_Booking_PP;Username=postgres;Password=3115
 
volumes:
  booking_pp-data:

I launch docker compose using this button:

enter image description here

Mistake. If the linux container is configured in docker:

Your Docker server host is configured for 'Linux', however the docker-compose project targets 'Windows'.

Mistake. If the windows container is configured in docker:

no matching manifest for windows(10.0.26200)/amd64 in the manifest list entries. If the error persists, try restarting Docker Desktop.

Turning on the experimental version of Docker did not help. Disabling Hyper-V didn't help either.

asp.net-mvc postgresql docker docker-compose visual-studio-2022