microsoft / DockerTools

Tools For Docker, including Visual Studio Provisioning and Publishing
Other
175 stars 26 forks source link

Unable to launch Docker Compose project after 16.10 update #301

Closed dahlsailrunner closed 3 years ago

dahlsailrunner commented 3 years ago

I seem to be unable to launch a docker compose project after upgrading to 16.10 this week. I'm trying to run a compose project via the debugger and the behavior has been that the build succeeds but the project never launches. Of note is that I also cannot seem to be able to choose "Start Debugging" as shown here: https://devblogs.microsoft.com/visualstudio/visual-studio-2019-v16-10-preview-2/#new-features-for-containers

I only see the "Do not start" and "Start without debugging" options. image

The compose file I'm trying to start is this (3 .NET 5 aspnet projects and sql server):

version: '3.4'

services:
  unified.core.rentroll.api:
    build:
      context: .
      dockerfile: Unified.Core.RentRoll.API/Dockerfile
  unified.core.rentroll.consumers:
    build:
      context: .
      dockerfile: Unified.Core.RentRoll.Consumers/Dockerfile
  unified.core.rentroll.hangfire.service:
    build:
      context: .
      dockerfile: Unified.Core.RentRoll.HangFire.Service/Dockerfile
  database:
      ![image](https://user-images.githubusercontent.com/8389867/119980971-a8962d00-bf82-11eb-91e9-442e7fb2627c.png): mcr.microsoft.com/mssql/server
      environment:
        - SA_PASSWORD=redacted
        - ACCEPT_EULA=Y
      ports:
        - 1439:1433

When I ran docker compose up from the command line everything launched fine.

But the output I'm generally seeing from the container tools window when hitting "F5" is as follows (and no containers are running at the end; the "Docker Compose Run" button in VS becomes re-enabled):

========== Preparing Containers ==========
Getting Docker containers ready...
A non-critical error occurred while getting containers ready.  Your project will continue to function normally.  The error was: Unable to find the template docker-compose.vs.debug.yml. 
========== Debugging ==========
docker-compose  -f "C:\Users\dahls\source\repos\unified-core-rentroll-api\docker-compose.yml" -f "C:\Users\dahls\source\repos\unified-core-rentroll-api\docker-compose.override.yml" -f "C:\Users\dahls\source\repos\unified-core-rentroll-api\obj\Docker\docker-compose.vs.debug.g.yml" -p dockercompose10851896996691003312 --no-ansi config
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
services:
  database:
    environment:
      ACCEPT_EULA: "Y"
      SA_PASSWORD: redacted
    image: mcr.microsoft.com/mssql/server
    ports:
    - published: 1439
      target: 1433
  unified.core.rentroll.api:
    build:
      context: C:\Users\dahls\source\repos\unified-core-rentroll-api
      dockerfile: Unified.Core.RentRoll.API/Dockerfile
      labels:
        com.microsoft.created-by: visual-studio
        com.microsoft.visual-studio.project-name: Unified.Core.RentRoll.API
      target: base
    container_name: Unified.Core.RentRoll.API
    entrypoint: tail -f /dev/null
    environment:
      ASPNETCORE_ENVIRONMENT: local
      ASPNETCORE_LOGGING__CONSOLE__DISABLECOLORS: "true"
      ASPNETCORE_URLS: https://+:8080
      DOTNET_USE_POLLING_FILE_WATCHER: '1'
      NUGET_FALLBACK_PACKAGES: ''
      URR_ConnectionStrings__CoreDb: Server=database;Database=RentRoll;User ID=sa;Password=redacted;MultipleActiveResultSets=True
      URR_ConnectionStrings__DBConnection: Server=host.docker.internal;Database=RentRoll;User
        ID=rentroll;Password=redacted;MultipleActiveResultSets=True
      URR_EnterpriseGateway__ApiKey: redacted
      URR_EnterpriseGateway__ProvisioningKey: redacted
      URR_Ftp__Password: redacted
      URR_Integration__OneSite__OneSiteAuthClientSecret: redacted
      URR_Integration__OneSite__WebServicePassword: redacted
      URR_LaunchDarkly__SdkKey: redacted
      URR_Vault__Role: urr-urr-api-dev-role
      URR_Vault__SecretId: redacted
    image: unifiedcorerentrollapi:dev
    labels:
      com.microsoft.visualstudio.debuggee.arguments: ' --additionalProbingPath /root/.nuget/packages  ""'
      com.microsoft.visualstudio.debuggee.killprogram: /bin/sh -c "if PID=$$(pidof
        dotnet); then kill $$PID; fi"
      com.microsoft.visualstudio.debuggee.program: dotnet
      com.microsoft.visualstudio.debuggee.workingdirectory: /app
    ports:
    - published: 44334
      target: 8080
    tty: true
    volumes:
    - C:\Users\dahls\source\repos\unified-core-rentroll-api\Unified.Core.RentRoll.API:/app:rw
    - C:\Users\dahls\vsdbg\vs2017u5:/remote_debugger:rw
    - C:\Users\dahls\AppData\Roaming\ASP.NET\Https:/root/.aspnet/https:ro
    - C:\Users\dahls\AppData\Roaming\Microsoft\UserSecrets:/root/.microsoft/usersecrets:ro
    - C:\Users\dahls\.nuget\packages:/root/.nuget/packages:ro
    - C:\Users\dahls\source\repos\unified-core-rentroll-api:/src:rw
  unified.core.rentroll.consumers:
    build:
      context: C:\Users\dahls\source\repos\unified-core-rentroll-api
      dockerfile: Unified.Core.RentRoll.Consumers/Dockerfile
      labels:
        com.microsoft.created-by: visual-studio
        com.microsoft.visual-studio.project-name: Unified.Core.RentRoll.Consumers
      target: base
    container_name: Unified.Core.RentRoll.Consumers
    entrypoint: tail -f /dev/null
    environment:
      DOTNET_ENVIRONMENT: local
      NUGET_FALLBACK_PACKAGES: ''
      URR_ConnectionStrings__DBConnection: Server=host.docker.internal;Database=RentRoll;User
        ID=rentroll;Password=redacted
      URR_Ftp__Password: redacted
      URR_LaunchDarkly__SdkKey: redacted
      URR_QueueSettings__Password: redacted
      URR_Vault__SecretId: redacted
    image: unifiedcorerentrollconsumers:dev
    labels:
      com.microsoft.visualstudio.debuggee.arguments: ' --additionalProbingPath /root/.nuget/packages  ""'
      com.microsoft.visualstudio.debuggee.killprogram: /bin/sh -c "if PID=$$(pidof
        dotnet); then kill $$PID; fi"
      com.microsoft.visualstudio.debuggee.program: dotnet
      com.microsoft.visualstudio.debuggee.workingdirectory: /app
    tty: true
    volumes:
    - C:\Users\dahls\source\repos\unified-core-rentroll-api\Unified.Core.RentRoll.Consumers:/app:rw
    - C:\Users\dahls\vsdbg\vs2017u5:/remote_debugger:rw
    - C:\Users\dahls\.nuget\packages:/root/.nuget/packages:ro
  unified.core.rentroll.hangfire.service:
    build:
      context: C:\Users\dahls\source\repos\unified-core-rentroll-api
      dockerfile: Unified.Core.RentRoll.HangFire.Service/Dockerfile
      labels:
        com.microsoft.created-by: visual-studio
        com.microsoft.visual-studio.project-name: Unified.Core.RentRoll.HangFire.Service
      target: base
    container_name: Unified.Core.RentRoll.HangFire.Service
    entrypoint: tail -f /dev/null
    environment:
      ASPNETCORE_LOGGING__CONSOLE__DISABLECOLORS: "true"
      ASPNETCORE_URLS: https://+:8080
      DOTNET_ENVIRONMENT: local
      DOTNET_USE_POLLING_FILE_WATCHER: '1'
      NUGET_FALLBACK_PACKAGES: ''
      URR_ConnectionStrings__DBConnection: Server=host.docker.internal;Database=RentRoll;User
        ID=rentroll;Password=redacted;MultipleActiveResultSets=True
      URR_ConnectionStrings__HangFireDBConnection: Server=host.docker.internal;Database=HangFire;User
        ID=rentroll;Password=redacted;MultipleActiveResultSets=True
      URR_EnterpriseGateway__ApiKey:redacted
      URR_Integration__OneSite__OneSiteAuthClientSecret: redacted
      URR_Integration__OneSite__WebServicePassword: redacted
      URR_LaunchDarkly__SdkKey: redacted
      URR_Vault__Role: urr-api-dev-role
      URR_Vault__SecretId: redacted
    image: unifiedcorerentrollhangfireservice:dev
    labels:
      com.microsoft.visualstudio.debuggee.arguments: ' --additionalProbingPath /root/.nuget/packages  ""'
      com.microsoft.visualstudio.debuggee.killprogram: /bin/sh -c "if PID=$$(pidof
        dotnet); then kill $$PID; fi"
      com.microsoft.visualstudio.debuggee.program: dotnet
      com.microsoft.visualstudio.debuggee.workingdirectory: /app
    ports:
    - published: 44333
      target: 8080
    tty: true
    volumes:
    - C:\Users\dahls\source\repos\unified-core-rentroll-api\Unified.Core.RentRoll.HangFire.Service:/app:rw
    - C:\Users\dahls\vsdbg\vs2017u5:/remote_debugger:rw
    - C:\Users\dahls\AppData\Roaming\ASP.NET\Https:/root/.aspnet/https:ro
    - C:\Users\dahls\AppData\Roaming\Microsoft\UserSecrets:/root/.microsoft/usersecrets:ro
    - C:\Users\dahls\.nuget\packages:/root/.nuget/packages:ro
    - C:\Users\dahls\source\repos\unified-core-rentroll-api:/src:rw
version: '3.4'
docker-compose  -f "C:\Users\dahls\source\repos\unified-core-rentroll-api\docker-compose.yml" -f "C:\Users\dahls\source\repos\unified-core-rentroll-api\docker-compose.override.yml" -p dockercompose10851896996691003312 --no-ansi config --services
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
unified.core.rentroll.consumers
unified.core.rentroll.api
unified.core.rentroll.hangfire.service
database
docker-compose  -f "C:\Users\dahls\source\repos\unified-core-rentroll-api\docker-compose.yml" -f "C:\Users\dahls\source\repos\unified-core-rentroll-api\docker-compose.override.yml" -p dockercompose10851896996691003312 --no-ansi config
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
services:
  database:
    environment:
      ACCEPT_EULA: "Y"
      SA_PASSWORD: redacted
    image: mcr.microsoft.com/mssql/server
    ports:
    - published: 1439
      target: 1433
  unified.core.rentroll.api:
    build:
      context: C:\Users\dahls\source\repos\unified-core-rentroll-api
      dockerfile: Unified.Core.RentRoll.API/Dockerfile
    environment:
      ASPNETCORE_ENVIRONMENT: local
      ASPNETCORE_URLS: https://+:8080
      URR_ConnectionStrings__CoreDb: Server=database;Database=RentRoll;User ID=sa;Password=redacted;MultipleActiveResultSets=True
      URR_ConnectionStrings__DBConnection: Server=host.docker.internal;Database=RentRoll;User
        ID=rentroll;Password=redacted;MultipleActiveResultSets=True
      URR_EnterpriseGateway__ApiKey: redacted
      URR_EnterpriseGateway__ProvisioningKey: redacted
      URR_Ftp__Password: redacted
      URR_Integration__OneSite__OneSiteAuthClientSecret: redacted
      URR_Integration__OneSite__WebServicePassword: redacted
      URR_LaunchDarkly__SdkKey: redacted
      URR_Vault__Role: urr-urr-api-dev-role
      URR_Vault__SecretId: redacted
    ports:
    - published: 44334
      target: 8080
    volumes:
    - C:\Users\dahls\AppData\Roaming\ASP.NET\Https:/root/.aspnet/https:ro
    - C:\Users\dahls\AppData\Roaming\Microsoft\UserSecrets:/root/.microsoft/usersecrets:ro
  unified.core.rentroll.consumers:
    build:
      context: C:\Users\dahls\source\repos\unified-core-rentroll-api
      dockerfile: Unified.Core.RentRoll.Consumers/Dockerfile
    environment:
      DOTNET_ENVIRONMENT: local
      URR_ConnectionStrings__DBConnection: Server=host.docker.internal;Database=RentRoll;User
        ID=rentroll;Password=redacted
      URR_Ftp__Password: redacted
      URR_LaunchDarkly__SdkKey: redacted
      URR_QueueSettings__Password: redacted
      URR_Vault__SecretId: redacted
  unified.core.rentroll.hangfire.service:
    build:
      context: C:\Users\dahls\source\repos\unified-core-rentroll-api
      dockerfile: Unified.Core.RentRoll.HangFire.Service/Dockerfile
    environment:
      ASPNETCORE_URLS: https://+:8080
      DOTNET_ENVIRONMENT: local
      URR_ConnectionStrings__DBConnection: Server=host.docker.internal;Database=RentRoll;User
        ID=rentroll;Password=redacted;MultipleActiveResultSets=True
      URR_ConnectionStrings__HangFireDBConnection: Server=host.docker.internal;Database=HangFire;User
        ID=rentroll;Password=redacted;MultipleActiveResultSets=True
      URR_EnterpriseGateway__ApiKey: redacted
      URR_Integration__OneSite__OneSiteAuthClientSecret: redacted
      URR_Integration__OneSite__WebServicePassword: redacted
      URR_LaunchDarkly__SdkKey: redacted
      URR_Vault__Role: urr-api-dev-role
      URR_Vault__SecretId: redacted
    ports:
    - published: 44333
      target: 8080
    volumes:
    - C:\Users\dahls\AppData\Roaming\ASP.NET\Https:/root/.aspnet/https:ro
    - C:\Users\dahls\AppData\Roaming\Microsoft\UserSecrets:/root/.microsoft/usersecrets:ro
version: '3.4'
dahlsailrunner commented 3 years ago

It turns out this entire problem was caused when we updated the three projects from using netcoreapp3.1 to net5 -- we INCORRECTLY set the net5 value and should have used net5.0 in the csproj files. Once we changed this everything lit up again.