cwrc / CWRC-GitWriter-Docker

Docker Compose orgistrated CWRC-Writer with included GitHub connector, NERVE, and Validation service
GNU General Public License v3.0
0 stars 0 forks source link

Unable to map files into Windows container #11

Open lbotinelly opened 4 years ago

lbotinelly commented 4 years ago

Summary Not able to start the docker-compose stack in Windows Server.

Description When starting the stack on a Windows Server with docker-compose up -d, the following log is presented:

ERROR: for gitwriter  Cannot create container for service gitwriter: invalid volume specification: 'C:\repo\CWRC-GitWriter-Docker\container_volumes\cwrc-gitwriter\config.json:/apps/CWRC-GitWriter/build/config/config.json:rw': invalid mount config for type "bind": source path must be a directory
ERROR: for gitserver  Cannot create container for service gitserver: invalid volume specification: 'C:\repo\CWRC-GitWriter-Docker\container_volumes\cwrc-gitserver\config.json:/apps/CWRC-GitServer/config.json:rw': invalid mount config for type "bind": source path must be a directory
ERROR: for gitwriter  Cannot create container for service gitwriter: invalid volume specification: 'C:\repo\CWRC-GitWriter-Docker\container_volumes\cwrc-gitwriter\config.json:/apps/CWRC-GitWriter/build/config/config.json:rw': invalid mount config for type "bind": source path must be a directory
ERROR: Encountered errors while bringing up the project.

This seems to be related to reported issues across other stacks:

https://github.com/docker/for-win/issues/376 https://github.com/moby/moby/issues/30555

According to this comment, "Bind mounting files is a Linux specific quirk, no other Unix or non Unix OS I know of supports it[...]"

A possible solution replicating suggestions from similar threads would involve mapping the directories and then read the individual JSON configuration files as necessary.

Docker for Windows do not support file binding.

lucaju commented 4 years ago

Hi @lbotinelly . Thanks for point this out. I made the changes and push to the dev branch. b50080bb2f5a8ec87b606cc43113822f480027ae I will test it on our dev server tomorrow before pushing it to production.

lucaju commented 4 years ago

Hi @lbotinelly . It seems your proposed solution worked well on Linux. But beyond the modification on this repo b50080bb2f5a8ec87b606cc43113822f480027ae I had to relocate the config file on GitServer repo as well https://github.com/cwrc/CWRC-GitServer/commit/3d7e729145d850e106a2566ffb886bdde959d512

Unfortunately, I can't move the code to production to the master branch just yet. @ilovan is testing the latest change we recently made on the code and will be away next week. I hope to be able to merge code when I come back on the week after. I'll keep you posted.