2017-09-28 5 views
0

사용자 정의 mdocker 이미지 기반을 (FROM) php:7.0-fpm-alpine 이미지에 빌드하고 내 Dockerfile은 다음과 같은 내용mongodb pecl 패키지 설치 문제 :/tmp/pear/temp/mongodb/configure : ./configure.lineno : 줄 1 : 구문 오류 : 끝나지 않은 따옴표 붙은 문자열

FROM php:7.0-fpm-alpine 
MAINTAINER John Doe <[email protected]>  

RUN apk update &&\ 
    apk add --update --virtual build_deps gcc g++ autoconf make openssl-dev pcre-dev &&\ 
    docker-php-source extract &&\ 
    pecl install mongodb && \ 
    docker-php-ext-enable mongodb && \ 
    docker-php-source delete && \ 
    apk del build_deps autoconf gcc g++ make && \ 
    rm -rf /var/cache/apk/* && \ 
    rm -rf /tmp/* 

을 가지고 있도록하여 MongoDB의 확장자를 설치해야하지만, 나는 다음과 같은 이미지를 빌드 할 때 나는 출력 다음 (고산 패키지의 출력은 ommited 된 설치합니다) 얻을 위 :

downloading mongodb-1.3.0.tgz ... 
Starting to download mongodb-1.3.0.tgz (927,842 bytes) 
.........................................................................................................................................................................................done: 927,842 bytes 
417 source files, building 
running: phpize 
Configuring for: 
PHP Api Version:   20151012 
Zend Module Api No:  20151012 
Zend Extension Api No: 320151012 
building in /tmp/pear/temp/pear-build-defaultuserfgCbfi/mongodb-1.3.0 
running: /tmp/pear/temp/mongodb/configure --with-php-config=/usr/local/bin/php-config 
checking for grep that handles long lines and -e... /bin/grep 
checking for egrep... /bin/grep -E 
checking for a sed that does not truncate output... /bin/sed 
expr: syntax error 
sh: 0: unknown operand 
expr: syntax error 
sh: 0: unknown operand 
checking for cc... cc 
checking whether the C compiler works... yes 
checking for C compiler default output file name... a.out 
checking for suffix of executables... 
checking whether we are cross compiling... no 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether cc accepts -g... yes 
checking for cc option to accept ISO C89... none needed 
checking how to run the C preprocessor... cc -E 
checking for icc... no 
checking for suncc... no 
checking whether cc understands -c and -o together... yes 
checking for system library directory... lib 
checking if compiler supports -R... no 
checking if compiler supports -Wl,-rpath,... yes 
checking build system type... x86_64-unknown-linux-gnu 
checking host system type... x86_64-unknown-linux-gnu 
checking target system type... x86_64-unknown-linux-gnu 
checking for PHP prefix... /usr/local 
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib 
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20151012 
checking for PHP installed headers prefix... /usr/local/include/php 
checking if debug is enabled... no 
checking if zts is enabled... no 
checking for re2c... no 
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. 
checking for gawk... no 
checking for nawk... no 
checking for awk... awk 
checking if awk is broken... no 
checking whether to enable mongodb support... yes, shared 
checking OpenSSL dir for mongodb... yes 
checking whether to use system default cipher list instead of hardcoded value... no 
checking PHP version... 70022 
/tmp/pear/temp/mongodb/configure: ./configure.lineno: line 1: syntax error: unterminated quoted string 
ERROR: `/tmp/pear/temp/mongodb/configure --with-php-config=/usr/local/bin/php-config' failed 
Removing intermediate container 288e5589f2ca 

나는 다음과 같은 것을 알 수있다. 오류 :

/tmp/pear/temp/mongodb/configure: ./configure.lineno: line 1: syntax error: unterminated quoted string 

친구에게이 문제를 해결할 수있는 방법이 있습니까?

+1

의 이름을 줄 필요가 apk del에 대한

FROM php:7.0-fpm-alpine MAINTAINER John Doe <[email protected]> RUN apk update &&\ apk add --update --virtual build_deps bash gcc g++ autoconf make openssl-dev pcre-dev &&\ docker-php-source extract &&\ /bin/bash -lc "pecl install mongodb" && \ docker-php-ext-enable mongodb && \ docker-php-source delete && \ apk del build_deps && \ rm -rf /var/cache/apk/* && \ rm -rf /tmp/* 

또한 떠들썩한 파티를 통해 실행 간단합니다. mongodb.org/browse/PHPC-1014 – olvlvl

답변

2

문제점은 mongodb에 대한 pecl 스크립트를 작성한 사람이 bash에서 테스트했고 sh이 아니라는 것입니다. 따라서 스크립트는 sh와 호환되지 않습니다. HTTPS : // JIRA 솔루션은 열어 티켓이있다, 당신은 단지 가상 패키지이 새로 도입 버그