不能在码头集装箱中安装肥皂

我有docker这个问题,我想在我的容器中安装肥皂,但它永远不会工作。 如果我运行这个图像,并尝试php -m它不会显示肥皂。 如果我运行这个图像,并执行此操作:

 apt-get install -y libxml++2.6-dev && docker-php-ext-install soap 

php -m ,然后它的工作。 我真的不明白这个行为,并会喜欢一些帮助!

 FROM php:5.6-cli RUN apt-get update -yqq RUN apt-get install git -yqq RUN apt-get install wget -yqq RUN apt-get install libssl-dev -yqq RUN apt-get install -yqq libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev RUN apt-get clean -yqq RUN wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" RUN php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" RUN php composer-setup.php RUN php -r "unlink('composer-setup.php'); unlink('installer.sig');" RUN mv composer.phar /usr/bin RUN docker-php-ext-install mysqli RUN docker-php-ext-install zip RUN docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-gif-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd RUN pecl install mongo RUN echo "extension=mongo.so" > /usr/local/etc/php/conf.d/ext-mongo.ini RUN pecl install mongodb RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/ext-mongodb.ini ADD ssh_key /root/.ssh/id_rsa ADD ssh_key.pub /root/.ssh/id_rsa.pub RUN echo " IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config RUN echo "Host *\n\tStrictHostKeyChecking no" > /etc/ssh/ssh_config RUN apt-get install -y libxml++2.6-dev && docker-php-ext-install soap 

编辑:这里是php -m的输出

 [PHP Modules] Core ctype curl date dom ereg fileinfo filter ftp gd hash iconv json libxml mbstring mcrypt mongo mongodb mysqli mysqlnd openssl pcre PDO pdo_sqlite Phar posix readline Reflection session SimpleXML SPL sqlite3 standard tokenizer xml xmlreader xmlwriter zip zlib [Zend Modules] 

你需要安装一个扩展php5.6-xml,见需求

http://php.net/manual/en/soap.requirements.php

我已经用这个脚本安装了php soapDockerfile

 RUN apt-get update && apt-get install -y libxml2-dev php-soap && docker-php-ext-install soap