我正在尝试在 gitpod.io 中运行 php-fpm。
但是当我运行以下命令时......
service php7.1-fpm start
...Gitpod 控制台返回权限错误,我无法在 gitpod 控制台中使用 sudo。我能做些什么来解决这个问题。
错误:> mkdir: cannot create directory ‘/run/php’: Permission denied . That error are show in my gitpod console
我的码头文件:
FROM gitpod/workspace-full:latest
# optional: use a custom Nginx config.
COPY ./nginx.conf /etc/nginx/nginx.conf
COPY ./docker-run.sh /
# optional: change document root folder. It's relative to your git working copy.
ENV NGINX_DOCROOT_IN_REPO="www"
USER root
RUN apt-get update \
&& apt-get -y install mysql-server mysql-client \
&& apt-get -y install php-fpm php-cli php-bz2 php-bcmath php-gmp php-imap php-shmop php-soap php-xmlrpc php-xsl php-ldap \
&& apt-get -y install php-amqp php-apcu php-imagick php-memcached php-mongodb php-oauth php-redis\
&& apt-get clean && rm -rf /var/cache/apt/* /var/lib/apt/lists/* /tmp/*
RUN mkdir /var/run/mysqld \
&& chown -R gitpod:gitpod /var/run/mysqld /usr/share/mysql /var/lib/mysql /var/log/mysql /etc/mysql
COPY ./my.cnf /etc/mysql/my.cnf
RUN mysqld --daemonize --skip-grant-tables \
&& sleep 3 \
&& ( mysql -uroot -e "USE mysql; UPDATE user SET authentication_string=PASSWORD(\"root\") WHERE user='root'; UPDATE user SET plugin=\"mysql_native_password\" WHERE user='root'; FLUSH PRIVILEGES;" ) \
&& mysqladmin -uroot -proot shutdown;
EXPOSE 80 443
对不起,我的英语很糟糕。