How you launched the docker container? Do you pass -v option when you start docker container via 'docker run'?
The file system can be reached by the process inside docker container is isolated from host. If you want to let your program inside the docker container to touch the files in your host, you should docker run -v /home/user/data/:/home/user/data/ <your-image-name>
when starting the docker container.
BTW, pls, don't use chmod 777 in most case. It's not a good idea.