fedora-cloud / Fedora-Dockerfiles

Fedora Dockerfiles - No longer maintained. See: https://fedoraproject.org/wiki/Changes/Layered_Docker_Image_Build_Service
GNU General Public License v2.0
401 stars 253 forks source link

cannot run fedora/apache image in env where root user is prohibited #245

Open surajssd opened 7 years ago

surajssd commented 7 years ago

$subject, so when i run docker.io/fedora/apache in an environment where root user/actions are prohibited(like openshift) container cannot boot up.

See following container log:

$ docker logs 9c50a64d5b97                                                                                                                                 
rm: cannot remove '/run/httpd/*': Permission denied
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
(13)Permission denied: AH00058: Error retrieving pid file /run/httpd/httpd.pid
AH00059: Remove it before continuing if it is corrupted.  
trishnaguha commented 7 years ago

This looks like an easyfix https://github.com/fedora-cloud/Fedora-Dockerfiles/blob/master/apache/run-apache.sh#L6 .

surajssd commented 7 years ago

@trishnaguha but that line seems to be there for a reason!

If you need help recreating this issue please tell me.

mdeguzis commented 6 years ago

I would enter the docker image and check the permissions on /run/httpd. In my case, I was trying to use the user httpd, when the start process is owned by apache. I suppose you could add httpd user to apache group too.

docker run -itu 0 --entrypoint /bin/bash <IMAGE>
ls -la /run
ls -la /run/httpd