To share folder between docker host and docker container, try below command
$ docker run -v "$(pwd):$(pwd)" -i -t ubuntu
The -v flag mounts the current working directory into the container. When the host directory of a bind-mounted volume doesn’t exist, Docker will automatically create this directory on the host for you,
However, there are 2 problems we have here:
Solution:
Container: create a user say 'testuser', by default user id will be starting from 1000,
Host: create a group say 'testgroup' with group id 1000, and chown the directory to the new group(testgroup