python3.7 container throwing permission errors
I had to rebuild my container with some new code deployment and for some reason its now throwing a permission error trying to copy the nginx.conf file. I dont provide a custom one, nor do I try to run as a non-root user:
/entrypoint.sh: 45: /entrypoint.sh: cannot create /etc/nginx/nginx.conf: Permission denied
Any ideas as to why this might be happening?
@minsis are you using on openshift by any chance :)
I am having the same proble with heroku actually, from what I got, the container is not run as root user, you have to find a way to solve the permission problems.
@minsis are you using on openshift by any chance :)
lol, my openshift pod is failing to start while if I use oc debug into the pod it runs perfectly. It does took me a while to pinpoint the same error as suggested by this issue. Yes, openshift has some security controls that we have to bypass
Not sure what might be, it seems it could be OpenShift, but I'm not using that, I wouldn't know for sure or how to make OpenShift work.
If you try it with pure Docker, does it work?
Sorry for the long delay! 🙈 I wanted to personally address each issue/PR and they piled up through time, but now I'm checking each one in order.
for openshift, you will have 2 options
- add service account that runs this image to
anyuid. not recommended. - or update this image to use a nonroot account but in a root group
like this
https://github.com/litmuschaos/litmus/blob/00a29d8ac0d51032ee7a169f427267359836f379/litmus-portal/graphql-server/Dockerfile#L26
or this https://github.com/nginxinc/docker-nginx-unprivileged/pull/10/files
Thanks for the help @tuananh !
@minsis you can check if that works for you.
Also, have in mind that you probably don't really need this Docker image: https://github.com/tiangolo/uwsgi-nginx-docker#-warning-you-probably-dont-need-this-docker-image
Sorry it's been so long since I've worked with this container, I don't remember much about it or which project I was using it for. I think in the end I just ended up building my own container using the official python container. My usage was strictly docker running on a VM.
Cool! In that case, as this is no longer a problem, you can close the issue. 🤓
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.