0

There are lots of post on this topic but either they are discussing about docker run or linux or discussing about earlier version of docker/ docker compose. I am simply trying to share a config file that resides locally, with my container. The following is my docker compose

version: "3.8"

services:  
  TestService:
    image: testservicelogmon
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - C:\ProgramData\Solution Name\Project Name:C:\ProgramData\Solution Name\Project Name:RW

Note: "Solution Name" and "Project Name" have space between them, and my config file resides in Project name folder.

The images gets created successfully but I always have "Mounts": [] and "Volumes": null. I went through the documentation and some posts at SO but couldn't find anything that would solve this problem for me. Below are couple of links I referred to. Any help on this would be appreciated. Thanks !

Update: It's just not with this folder, it seems like I am not able to mount any folder, whereas if I do a docker runlike below it works perfectly fine.

docker run -it -v 'C:\ProgramData\Solution Name\Project Name:C:\ProgramData\C:\ProgramData\Solution Name\Project Name:RW' testservicelogmon:latest powershell

docker named volume with targeting windows local folder

volume binding using docker compose on windows

user_19240589
  • 97
  • 1
  • 14

1 Answers1

0

The code seems to work fine. I was making a stupid mistake of running the docker-compose build command followed by docker run. This way everything was working fine but the mounts would always show empty. All I had to do was run docker-compose build followed by docker-compose up and the mounts were populated as expected.

user_19240589
  • 97
  • 1
  • 14