I am running a containerized web based application on AWS ECS fargate for a few months now. But due to few issues with AWS my team planned to take it multicloud with GCP. So when deploy my container image on GCP Cloud Run it gives me this errors
ERROR: [pool www] failed to write the ACL of the socket '/run/php-fpm/www.sock': Operation not permitted (1)"
ERROR: FPM initialization failed
Then i tried to change permission make of /run/php-fpm using
chmod 777 -R /run/php-fpm
It again shows me same error
After than i run the container locally and exec into the container to check the www.sock file, its permission was
srw-rw----+ root root www.sock
and the permission of /run/php-fpm was
drwxrwxrwx. root root php-fpm
After that i tried to change permissions with
chmod 777 -R /run/php-fpm/*
in the docker file but it gives me an error that file doesn't exists
I also tried using setfacl but when i exec into container and check it locally the permission off www.sock is not changed and give same error when deployed on cloud run
I don't want to move to azure so i need the solution for cloud run only. I am using port 80 to expose to docker file
Here is my dockerfile
FROM amazonlinux:2
# Environment variables
ENV PORT 80
# Install dependencies
RUN amazon-linux-extras install php7.2
RUN yum clean metadata && yum update -y && \
yum install -y \
curl \
httpd httpd-tools\
git \
openssh-server \
openssh-clients \
php-cli php-pdo php-fpm php-json \
php-bcmath \
php-cli \
php-common \
php-dba \
php-devel \
php-embedded \
php-enchant\
php-gd\
php-intl \
php-lda\
php-mbstrin\
php-mysqlnd \
php-odbc \
php-pd\
php-pear.noarch \
php-pgsql\
php-process \
php-pspel \
php-recode \
php-snmp \
php-soap \
php-xml \
php-xmlrpc \
php-mbstring \
unzip \
&& ln -s /usr/sbin/httpd /usr/sbin/apache2 \
&& curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& ln -s /usr/local/bin/composer /usr/bin/composer
COPY github_key .
COPY httpd.conf /etc/httpd/conf/httpd.conf
# Install app
RUN rm -rf /var/www/html/* && mkdir -p /var/www/html
# git clone command
#few sed commands
WORKDIR /var/www/html/
RUN composer require mpdf/mpdf && \
chmod 777 -R vendor/mpdf/mpdf/tmp
EXPOSE $PORT
ENTRYPOINT ["sh", "-c", "/usr/sbin/php-fpm && /usr/sbin/apache2 -DFOREGROUND"]
setfacl
? – Rafael Lemos