5

I suppose the title says it all... I have a container set from php:7.0-fpm image.

In the Dockerfile, I run, apt-get update && apt-get install -y php-soap. However, it fails and returned 100 as exit code. Additionally, there is E: Package 'php-soap' has no installation candidate as well.

Based on this discussion, I need to install apt-transport-https. I put that to be installed in the Dockerfile, but still the same error. What should I do?

notalentgeek
  • 4,939
  • 11
  • 34
  • 53
  • I just saw same issue from Dockerfile build on Travis CI. Build works fine locally, however. With `php:5.6-apache` image – Mike S. Jan 18 '18 at 16:29

2 Answers2

9

The FPM image brings php from the source. When you run apt-get install php-soap, you get php from APT, which comes with a different version. At least that understood.

Provisional fix:

RUN rm /etc/apt/preferences.d/no-debian-php

In the future, avoid using apt-get to install php dependencies.

nickgryg
  • 25,567
  • 5
  • 77
  • 79
  • Still don't get what you meant. I thought my option is to use Ubuntu/Debian image. Or, someway I install PHP Soap package. I think you suggest the latter. So, how can I install PHP deps that usually come from `apt-get`? – notalentgeek Jan 04 '18 at 15:35
  • This worked for me. Was getting 'not a candidate' errors from apt-get calls on debian. Installed this line of code above my apt-get calls and everything worked. – eric Feb 25 '18 at 23:05
  • man, dont even how to thanks, you saved me after investigating for several hours , also eg here - https://unix.stackexchange.com/questions/383999/why-are-some-packages-not-available-in-my-debian-jessie-installation – FantomX1 Aug 29 '18 at 20:36
3

This fixed my problem. In your php-fpm\Dockerfile change this:

RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install the soap extension apt-get update -yqq && \ apt-get -y install libxml2-dev php-soap && \ docker-php-ext-install soap \ ;fi

Into this:

RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install the soap extension rm /etc/apt/preferences.d/no-debian-php && \ apt-get update -yqq && \ apt-get -y install libxml2-dev php-soap && \ docker-php-ext-install soap \ ;fi

Also see this issue.

Soroush
  • 907
  • 1
  • 9
  • 27