I’ve created a Docker image that I use to (bind) mount a folder where there is my C/C++ project. The project is under GIT control where I use also submodules. Inside the container when I try to add a GIT submodule I receive this error:
error: could not write config file .gitmodules: Device or resource busy
Is there someone that use GIT submodule inside a Linux container mounted with the “bind” option?
I’m using vscode to run the container and to manage the project. The default user is “root” so I think I have the necessary permissions to write the file. Below you can see the output of “ls -al” command.
Sometimes I’m able to write to the file sometimes no.
WORKING:
root@4a80811ca394:/workspaces/Template_STM32H563# git submodule add --force https://github.com/stm32_mw_freertos.git libraries/middlewares/freertos
Adding existing repo at ‘libraries/middlewares/freertos’ to the index
ERROR EXAMPLE:
root@4a80811ca394:/workspaces/Template_STM32H563# git submodule add --force https://github.com/stm32_mw_freertos.git libraries/middlewares/freertos
Adding existing repo at ‘libraries/middlewares/freertos’ to the index fatal: please make sure that the .gitmodules file is in the working tree