Docker Community Forums

Share and learn in the Docker community.

Strange File Permission Error


(Singhjoga) #1

Hi Guys,
I have started working on docker recently. I first created the docker image with Dockerfile then installed the required application by logging into the container.

Now when I run the container and start this application, it cannot create/open a log file. Given file path certainly exists. If try to create manually this file, it works. To debug the issue, I used the strace to see the exact instruction. See below the further details.

== running docker
docker run --privileged=true -t -v /home/docker/share:/share -i ems

===========strace output======================
epoll_create(64) = 0
socketpair(PF_LOCAL, SOCK_STREAM, 0, [3, 4]) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl(4, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl(3, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK)
mmap(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f51c1bb0000
mprotect(0x7f51c1bb0000, 4096, PROT_NONE) = 0
clone(child_stack=0x7f51c23affb0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidpt r=0x7f51c23b09d0, tls=0x7f51c23b0700, child_tidptr=0x7f51c23b09d0) = 33
futex(0x988918, FUTEX_WAKE_PRIVATE, 1) = 1
open("/var/app/soa/share/tibco/configs/S2_SHRLNX_EMS/tibco/cfgmgmt/ems/data/datastore/logfile", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EACCES (Permission denied)

I am using docker 1.9.1

Thanks in advance for any kind of clues.

Regards,

Joga


(Singhjoga) #2

Looks like it is Volumes issue. Need to debug it.


(Collinestes) #3

I’m experiencing the same behavior and have yet to find a workaround, it works fine on Ubuntu but can’t seem to get the permission set right on a volume i’m mounting as well.

If you happen to come up with a workaround please post here, I’ll do the same.