总而言之,我的问题是使用命令/usr/local/lib/php/
后删除了文件夹docker-php-ext-install
的内容
我创建了一个在计算机上成功构建的Docker文件,当我的开发人员克隆我的存储库时,问题就开始了,他在尝试执行命令Could not open input file: /usr/local/lib/php/peclcmd.php
时收到错误消息:yes '' | pecl install mcrypt-1.0.1
我已经调试了问题,/usr/local/lib/php/
的文件夹内容为:
归档构建控制台数据文档扩展名OS PEAR pearcmd.php PEAR.php peclcmd.php结构System.php测试XML
使用docker-php-ext-install
的第一个命令后,剩下的唯一文件夹是extensions
这是Dockerfile:
FROM quay.io/alexcheng1982/apache2-php7:7.2.12
ENV MAGENTO_VERSION 2.3.0
ENV INSTALL_DIR /var/www/html
ENV COMPOSER_HOME /var/www/.composer/
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& composer global require hirak/prestissimo
COPY ./auth.json $COMPOSER_HOME
RUN requirements="libpng12-dev libmcrypt-dev libmcrypt4 libcurl3-dev libfreetype6 libjpeg-turbo8 libjpeg-turbo8-dev libpng12-dev libfreetype6-dev libicu-dev libxslt1-dev unzip" \
&& apt-get update \
&& apt-get install -y $requirements \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install zip \
&& docker-php-ext-install intl \
&& docker-php-ext-install xsl \
&& docker-php-ext-install soap \
&& docker-php-ext-install bcmath \
&& requirementsToRemove="libpng12-dev libmcrypt-dev libcurl3-dev libpng12-dev libfreetype6-dev libjpeg-turbo8-dev" \
&& apt-get purge --auto-remove -y $requirementsToRemove
RUN apt-get update \
&& apt-get install -y libmcrypt-dev \
&& yes '' | pecl install mcrypt-1.0.1 \
&& echo 'extension=mcrypt.so' > /usr/local/etc/php/conf.d/mcrypt.ini
Docker版本18.09.1,docker-compose版本1.22.0