Here I'm not asking about how to mount a directory from the host machine to a docker container, but instead how can I edit a mounted directory from a container.
I'll give more details about my use case
Now I'm working on a Gitlab fork, and using GDK (Gitlab Development Kit) and during the installation, I run this command:
gdk install gitlab_repo=https://gitlab.com/MY-FORK/gitlab.git
This command will create a directory inside the project called gitlab
And to work on the project, I'll be working using a text-editor from the host machine, so I need to sync the two directories
This was my attempt:
docker run -it -p 3000:3000 -v /gitlab:${project-location}/gitlab ${image-name}
The problem with this approach is when I'm running the installation command:
gdk install gitlab_repo=https://gitlab.com/MY-FORK/gitlab.git
It fails because it's trying to change the files inside the mounted directory and this is not allowed (permission denied)
Hint: all the installation steps are described in a Dockerfile so everything is running inside the container!
So is there a workaround or another way of doing that?