我正在尝试从头开始构建php7 nginx docker映像。我需要作曲家。我正在关注this tutorial。这是我的dockerfile
FROM nginx:mainline-alpine
LABEL maintainer="Me <me@example.com>"
COPY start.sh /start.sh
COPY nginx.conf /etc/nginx/nginx.conf
COPY supervisord.conf /etc/supervisord.conf
copy site.conf /etc/nginx/sites-available/default.conf
RUN apk add --update \
php7 \
php7-fpm \
php7-pdo \
php7-pdo_mysql \
php7-mcrypt \
php7-mbstring \
php7-xml \
php7-openssl \
php7-json \
php7-zip \
php7-dom \
php7-session \
php7-zlib && \
php7 -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php7 composer-setup.php --install-dir=/usr/bin --filname=composer &&\
php7 -r "unlink('composer-setup.php');" &&\
ls -s /usr/bin/php7 /usr/bin/php && \
ln -s /etc/php7/php.ini /etc/php7/conf.d/php.ini
运行docker build
时出现以下错误
phar扩展名丢失。安装它或重新编译php而无需 --disable-phar
命令'/ bin / sh -c apk add --update php7 php7-fpm php7-pdo php7-pdo_mysql php7-mcrypt php7-mbstring php7-xml php7-openssl php7-json php7-zip php7-dom php7-session php7-zlib && php7 -r “ copy('https://getcomposer.org/installer','composer-setup.php');” && php7 composer-setup.php --install-dir = / usr / bin --filname = composer && php7 -r“ unlink('composer-setup.php');” && ls -s / usr / bin / php7 / usr / bin / php && ln -s /etc/php7/php.ini /etc/php7/conf.d/php.ini' 返回了非零代码:1
我尝试将php7-phar
添加到php扩展列表中。但是然后我又遇到另一个错误
/ bin / sh:php7-phar:找不到
如何缓解该错误,本质上我需要在码头工人镜像中放置composer
。