title: Docker php—install php extensions ssh2
body: <p>I am using the official php docker image as base for my application container, so the Dockerfile starts like so:  </p>
  
  <pre><code>FROM php:5.6-fpm-jessie
  </code></pre>
  
  <p>Later in the file I would like to have something like that:  </p>
  
  <pre><code> RUN apt-get update \
      &amp;&amp; apt-get install -y libssh2-1-dev libssh2-1 \
      &amp;&amp; docker-php-ext-install ssh2
  </code></pre>
  
  <p>But that tells me:</p>
  
  <pre><code>/usr/src/php/ext/ssh2 does not exist
  </code></pre>
  
  <p>So since that is a debian (yessie) based image, only the old php5 packages are available and php7 is installed by some tricky script in the <a href="https://stackoverflow.com/questions/46805787/docker-phpfpm-install-php-extensions">php:fpm dockerfile</a> and it seams that all extensions are compiled within the used php executable.</p>
  
  <p>How can I install more extensions in this scenario?</p>