1

UPDATE: This wasn't an issue when I setup my project on a Mac. I was using Fedora 24 in this problem.

I am trying to access my app in my docker instance. When I try and ls the mounted directory, I get a permission error:

root@591d02d0d6d2:/app#
ls: cannot open directory .: Permission denied

This is what my docker file looks like:

FROM pvlltvk/ubuntu-trusty-php-fpm-5.6

RUN apt-get install -y\
    php5-curl \
    php5-sybase \
    freetds-dev \
    libxml2-dev

ADD freetds.conf /etc/freetds/freetds.conf

USER root
RUN echo 'alias sf="php /app/app/console"' >> ~/.bashrc

WORKDIR /app

I know it's a permissions issue but I couldn't get any solutions to work. If I run ls -lh I can see that the owner id is 1000 and not root.

root@591d02d0d6d2:/# ls -lh
total 24K
drwxrwxr-x.   11 1000 1000 4.0K Dec 12 17:42 app //my project
drwxr-xr-x.    2 root root 4.0K Dec 13 08:25 bin
drwxr-xr-x.    2 root root    6 Apr 10  2014 boot
drwxr-xr-x.    5 root root  360 Dec 15 02:58 dev
Sam Munroe
  • 1,266
  • 2
  • 20
  • 41
  • Please include the steps you've taken to mount your volume and if it's a host volume, include the full permissions on your host, including any selinux policies (`ls -lZ .`). – BMitch Dec 15 '16 at 03:12
  • I dont see any steps which creates that directory + can you try it with sudo?? – harishr Dec 15 '16 at 03:16
  • try `docker run -d -u root ` – Farhad Farahi Dec 15 '16 at 06:02
  • ran this: sudo docker run -d -u root app_php and when I try and ssh into it I get: Error response from daemon: No such container: app_php. If u run docker ps I can see app_php running. I'm using command: docker exec -t -i app_php /bin/bash – Sam Munroe Dec 16 '16 at 02:03

0 Answers0