Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not open /etc/nginx/conf.d directory #74

Closed
shjanken opened this issue Jun 11, 2018 · 5 comments
Closed

Can not open /etc/nginx/conf.d directory #74

shjanken opened this issue Jun 11, 2018 · 5 comments

Comments

@shjanken
Copy link

shjanken commented Jun 11, 2018

first of all, sorry for my poor english

I use command

root > docker run -it --rm -v /root/dockers/openresty/conf.d/:/etc/nginx/conf.d/ openresty/openresty:stretch /bin/bash

to run a docker container.

Then I execute command in the docker

cd /etc/nginx/conf.d/
ls 

but get the permission problem.

ls: cannot open directory '.': Permission denied
@neomantra
Copy link
Member

Can you show the output of these commands:

# within container
ls -l /etc
ls -l /etc/nginx

# within host system
ls -l /root/dockers/openresty
ls -l /root/dockers/openresty/conf.d

I wonder if it is related to the issues like #24

@shjanken
Copy link
Author

# within container
ls -l /etc
...
lrwxrwxrwx. 1 root root     12 Jun 11 04:51 mtab -> /proc/mounts
drwxr-xr-x. 3 root root   4096 Jun  3 14:39 NetworkManager
-rw-r--r--. 1 root root     58 Apr 11 05:09 networks
drwxr-xr-x. 3 root root   4096 Jun  3 14:39 nginx
-rw-r--r--. 1 root root   1746 Apr  2 18:38 nsswitch.conf
-rw-r--r--. 1 root root   1735 Nov 30  2017 nsswitch.conf.bak
drwxr-xr-x. 3 root root   4096 Apr  2 18:38 openldap
...


ls -l /etc/nginx 
drwxr-xr-x. 2 root root 4096 Jun 11 03:17 conf.d
# within host system
ls -l /root/dockers/openresty

drwxr-xr-x. 2 root root 4096 6月  10 23:17 conf.d
-rw-r--r--. 1 root root   90 6月  10 23:21 Dockerfile

ls -l /root/dockers/openresty/conf.d

-rw-r--r--. 1 root root 148 6月  10 22:44 hello.conf

Thank you very much.

@neomantra
Copy link
Member

I think this is a general Docker usage issue versus something with OpenResty. For example, can you access your mount on a generic stretch image?

docker run --rm -v /root/dockers/openresty/conf.d/:/conf debian:stretch-slim /bin/bash

Googling around shows that it might have to do with SELinux. Search for:
docker cannot open directory '.': Permission denied

@shjanken
Copy link
Author

I got it.
Thanks for help.

@shjanken
Copy link
Author

finally, I use the command to solved the problem.

root > docker run -it --rm -v /root/dockers/openresty/conf.d:/etc/nginx/conf.d:z openresty/openresty:stretch /bin/bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants