Dockerfile drupal控制台访问被拒绝mkdir

时间:2017-03-23 09:30:49

标签: docker drupal console

我试图在docker中安装drupal控制台(在Linux Antergos下)。我发现了以下错误:

  

警告:mkdir():第49行的phar:///usr/local/bin/drupal/vendor/drupal/console-core/src/Utils/ConfigurationManager.php中的权限被拒绝

这是我的PHP dockerfile:

FROM php:7.0-fpm

RUN usermod -u 1000 www-data

# Set timezone 
RUN rm /etc/localtime 
RUN ln -s /usr/share/zoneinfo/Europe/Bruxelles /etc/localtime 
RUN "date"

RUN apt-get update && apt-get install -y \
    git \
    unzip \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libmcrypt-dev \
        libpng12-dev \
        mysql-client \
    && docker-php-ext-install -j$(nproc) iconv mcrypt \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install -j$(nproc) gd \
    && docker-php-ext-install mysqli pdo pdo_mysql mcrypt zip mbstring opcache json

# Install Xdebug / Redis 
RUN pecl install redis \
    && pecl install xdebug \
    && docker-php-ext-enable redis xdebug

# Set the Drush version. 
ENV DRUSH_VERSION 8.1.2

# Install Drush 8 with the phar file. 
RUN curl -fsSL -o /usr/local/bin/drush "https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar" && \   
  chmod +x /usr/local/bin/drush

# Download console. 
RUN curl https://drupalconsole.com/installer -L -o drupal.phar

# Install console. 
RUN mv drupal.phar /usr/local/bin/drupal && \
    chmod +x /usr/local/bin/drupal && \
    drupal init --override

# Create drush-backups dir 
RUN mkdir /var/www/drush-backups/

USER 1000 
WORKDIR /var/www/html

1 个答案:

答案 0 :(得分:0)

要解决这个问题,我必须通过composer安装Drupal Console。肯定有另一种解决方案,但它可以使用它。