vinnylinux
vinnylinux

Reputation: 7034

PHP & Docker: script unable to write to /tmp

I have created a Docker image with Nginx & PHP 5 for my project, but i'm getting a runtime error due to lack of permissions on /tmp. Does it have to be a volume or is there a special Dockerfile configuration for this?

fopen(/tmp/myerror.log): failed to open stream: Permission denied

Upvotes: 5

Views: 10283

Answers (2)

Damien le Goupillon
Damien le Goupillon

Reputation: 19

chmod 777 (please no ! )
chown -R yourmachinename:yourmachinename /tmp

Upvotes: 1

Eric Woodruff
Eric Woodruff

Reputation: 6410

I've had to add RUN chmod 777 -R /tmp && chmod o+t -R /tmp to my Dockerfile in the past

Upvotes: 6

Related Questions