Visual Studio 2017 Docker project on Windows volumes issue

I am checking a new Visual Studio 2017 with built in connectivity to Docker. Once done all things installed and solved a number of issues on establishing connection between Visual Studio and Docker running in VirtualBox VM i am facing and issue when VS is unable to run container due to volumes mapping. Having read a number of posts for similar issues, i still cant run it..

Its fully default .NET core sample-template app from VS 2017 with Docker support.

  • Docker on Windows Connecting to sql server from dotnetcore app
  • creating a docker container from a rootfs
  • Exclude path at Docker image build time to improve size
  • Deploying ASP.NET 5 app to EC2 in a Docker container
  • Docker container with ASP.NET Core libraries
  • Process window not proceeding after reader.ReadLine()
  • docker-compose.ci.build.yml

    version: '2'
    
    services:
      ci-build:
        image: microsoft/aspnetcore-build:1.0-1.1
        volumes:
          - .:/src
        working_dir: /src
        command: /bin/bash -c "dotnet restore ./WebApplication1.sln && dotnet publish ./WebApplication1.sln -c Release -o ./obj/Docker/publish"
    

    docker-compose.yml

    version: '2'
    
    services:
      webapplication1:
        image: webapplication1
        environment:
        - COMPOSE_CONVERT_WINDOWS_PATHS=1
        build:
          context: ./WebApplication1
          dockerfile: Dockerfile
    

    docker-compose.override.yml

    version: '2'
    
    services:
      webapplication1:
        environment:
          - ASPNETCORE_ENVIRONMENT=Development      
        ports:
          - "80"
    

    docker-compose.vs.debug.yml

    version: '2'
    
    services:
      webapplication1:
        image: webapplication1:dev
        build:
          args:
            source: ${DOCKER_BUILD_SOURCE}
        environment:
          - DOTNET_USE_POLLING_FILE_WATCHER=1    
        volumes:
          - ./WebApplication1:/app
          - ~/.nuget/packages:/root/.nuget/packages:ro
          - ~/clrdbg:/clrdbg:ro
        entrypoint: tail -f /dev/null
        labels:
          - "com.microsoft.visualstudio.targetoperatingsystem=linux"
    

    Dockerfile

    FROM microsoft/aspnetcore:1.1
    ARG source
    WORKDIR /app
    EXPOSE 80
    COPY ${source:-obj/Docker/publish} .
    ENTRYPOINT ["dotnet", "WebApplication1.dll"]
    

    Error:

    ERROR: for webapplication1 Cannot create container for service webapplication1: invalid bind mount spec “C:\Users\UserName\Documents\Visual Studio 2017\Projects\WebApplication1\WebApplication1:/app:rw”: invalid volume specification: ‘C:\Users\UserNameDocuments\Visual Studio 2017\Projects\WebApplication1\WebApplication1:/app:rw’

    Where the problem is? I tried escaping slashes and on and off COMPOSE_CONVERT_WINDOWS_PATHS, but result is all the time same. Please help out!

  • Implementing watchdog for docker services under sysd
  • When does Docker write to iptables?
  • How to define Kubernetes Job using a private docker registry?
  • How to build boot2docker.iso from source?
  • Error while setting up docker dev env
  • docker0 interface missing on osx
  • 2 Solutions collect form web for “Visual Studio 2017 Docker project on Windows volumes issue”

    I believe this is due to running the latest version of Docker Toolbox which isn’t passing through the DOCKER_BUILD_SOURCE environment variable. I don’t believe Docker Toolbox is planning to resolve this on their end since they are treating environment variables as they should; but visual studio will need an update or the default docker compose templates will need an update to handle this.

    Maybe related to missing shared drive in Docker?

    enter image description here

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.