title: How to add console app in docker compose?
body: <p>I have web app created in .net core and I added docker-compose with my app and SqlServer.
  Then I created console app witch do migration my database.
  But when I started my docker-compose in logs I see</p>
  <blockquote>
  <p>The specified framework can be found at:</p>
  <ul>
  <li><a href="https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&amp;framework_version=3.1.0&amp;arch=x64&amp;rid=debian.10-x64" rel="nofollow noreferrer">https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&amp;framework_version=3.1.0&amp;arch=x64&amp;rid=debian.10-x64</a></li>
  </ul>
  <p>It was not possible to find any compatible framework version
  The framework 'Microsoft.AspNetCore.App', version '3.1.0' was not found.</p>
  <ul>
  <li>No frameworks were found.</li>
  </ul>
  <p>You can resolve the problem by installing the specified framework and/or SDK.</p>
  </blockquote>
  <p>But I have .NET Core SDK 3.1.0, my web app use it.</p>
  <p>My docker-compose looks like this:</p>
  <pre><code>version: '3.4'
  
  services:
    productmanagment.api:
      image: ${DOCKER_REGISTRY-}productmanagmentapi
      container_name: web
      build:
        context: .
        dockerfile: ProductManagment.Api/Dockerfile
      depends_on:
        - db
        - migrator
    db:
      image: &quot;mcr.microsoft.com/mssql/server&quot;
      environment:
          SA_PASSWORD: &quot;MyPassword&quot;
          ACCEPT_EULA: &quot;Y&quot;
    migrator:
      image: ${DOCKER_REGISTRY-}productmanagmentmigrator
      container_name: migrator
      build:
        context: .
        dockerfile: ProductManagment.Migrator/Dockerfile
      depends_on:
        - db
      environment:
          DbConnection: &quot;Server=db;Database=ProductManagment;User=sa;Password=MyPassword&quot;
  </code></pre>
  <p>And Dockerfile in Migrator(Console App)</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim AS base
  WORKDIR /app
  
  FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
  WORKDIR /src
  COPY [&quot;ProductManagment.Migrator/ProductManagment.Migrator.csproj&quot;, &quot;ProductManagment.Migrator/&quot;]
  COPY [&quot;ProductManagment.Api.csproj&quot;, &quot;ProductManagment.Api/&quot;]
  RUN dotnet restore &quot;ProductManagment.Migrator/ProductManagment.Migrator.csproj&quot;
  COPY . .
  WORKDIR &quot;/src/ProductManagment.Migrator&quot;
  RUN dotnet build &quot;ProductManagment.Migrator.csproj&quot; -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish &quot;ProductManagment.Migrator.csproj&quot; -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app/publish .
  ENTRYPOINT [&quot;dotnet&quot;, &quot;ProductManagment.Migrator.dll&quot;]
  </code></pre>
  <p>How to run properly this Console app and how to check its logs?</p>