This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

FEniCS inability to create folders/files in Docker

+1 vote

Hi, I'm using Docker Toolbox on Windows 10.

Whenever I need to use FEniCS, I will type in

"fenicsproject run" or
"docker run -ti -v $(pwd):/home/fenics/shared -w /home/fenics/shared quay.io/fenicsproject/stable"

in the Docker Terminal, both of them works.

BUT I have a problem which is the fact that I cannot create new files or folders on the shared directory from the host(the directory which I ran "fenicsproject run" in). I am however able to write to or edit existing files/folders. I am also unable to delete files or folders.

fenics@13d1a0e48ba4:~/shared$ mkdir hi
mkdir: cannot create directory ‘hi’: Permission denied

I want to know if the same problem exists for anyone else and why and is there anything I can do to solve this?

This is an issue when I try to use "dolfin-convert" to convert a msh file to xml

fenics@4e37df571bb1:~/shared$ ls
Assignment.lnk  Gmsh.lnk  Google Chrome.lnk  VirtualBox.lnk  desktop.ini  t1.geo  t1.msh  t2.geo  t2.msh
fenics@4e37df571bb1:~/shared$ dolfin-convert t1.msh t1.xml
Traceback (most recent call last):
  File "/usr/local/bin/dolfin-convert", line 131, in <module>
    main(sys.argv[1:])
  File "/usr/local/bin/dolfin-convert", line 78, in main
    meshconvert.convert2xml(ifilename, ofilename, iformat=iformat)
  File "/usr/local/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 1299, in convert2xml
    convert(ifilename, XmlHandler(ofilename), iformat=iformat)
  File "/usr/local/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 1077, in __init__
    self.__ofile = file(ofilename, "wb")
IOError: [Errno 13] Permission denied: 't1.xml'

Thanks and any help will be appreciated. I am new to Docker and FEniCs.

closed with the note: The problem only exists in directories in /c/Users/<computer name>, e.g. Desktop, Documents and Videos, the problem doesn't exist in folders inside Videos or Documents
asked Jan 5, 2017 by YaoJ FEniCS Novice (140 points)
closed Jan 5, 2017 by YaoJ

I know this permission problem quite well. I tried it with some docker container options like "--priviledged True", but in the end my definitely not recommended workaround is to call "sudo chmod 777 -R "docker_conatiner_home_path" in a shell environment. After that is should work.

...