Can't launch app as Docker container in VS 2017

2

I installed VS 2017 and Docker for Windows. I created .NET Core Web API project in VS 2017, then added Docker support for this project. And trying to launch app as Docker container in Debug mode but it's failed for me with this error:

Cannot start service 'name': container 1b0c2da39774a91e508ae48476c1b918d7d6c863e2a1ad6ac105012998e0f22a 
encountered an error during Start: 
failure in a Windows system call: 
The compute system exited unexpectedly. (0xc0370106)

App is launched correctly only in Release mode but works bad.

Also I tried reinstall Docker and VS 2017, but it didn't help me. What do I do wrong?

docker
visual-studio-2017
docker-compose
asked on Stack Overflow Feb 2, 2018 by A. Gladkiy • edited Feb 2, 2018 by A. Gladkiy

1 Answer

0

I was getting this error when attempting to use a named volume in my docker compose file using Visual Studio 2017 with Docker CE 18.03.0-ce-win59 (16762) configured to run Windows containers on Windows 10.

Using the Docker compose file documentation as reference, my docker-compose.yml file looked something like this:

version: '3'

services:
  myserver:
    image: myserver
    build:
      context: .\myserver
      dockerfile: Dockerfile
    volumes:
      - folder:c:\folder

volumes:
  folder:

This would only work when I built ran a debug session inside of Visual Studio 2017. Attempting to start a release build in Visual Studio with the debugger on or off would result in the error. Attempting to bring the container up from the command line using "docker-compose up" also resulted in the error.

I managed to get it working by switching to a bind mount instead. I created a folder on my local machine "c:\folder" and then changed my docker-compose.yml to:

version: '3'

services:
  myserver:
    image: myserver
    build:
      context: .\myserver
      dockerfile: Dockerfile
    volumes:
      - c:\folder:c:\folder

This resolved the error for me regardless of the method used to bring the container up.

answered on Stack Overflow Apr 10, 2018 by James Blake

User contributions licensed under CC BY-SA 3.0