I am trying to install Xdebug with Docker and PhpStorm but when I put the code in Dockerfile, an error occurs.
Code:
FROM php:7.1-fpm
# Install selected extensions and other stuff
RUN apt-get update \
&& apt-get -y --no-install-recommends install php-xdebug \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \ && echo "zend_extension=/usr/lib/php/20160303/xdebug.so" > /etc/php/7.1/mods-available/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /etc/php/7.1/mods-available/xdebug.ini \
&& echo "xdebug.remote_handler=dbgp" >> /etc/php/7.1/mods-available/xdebug.ini \
&& echo "xdebug.remote_port=9000" >> /etc/php/7.1/mods-available/xdebug.ini \
&& echo "xdebug.remote_autostart=on" >> /etc/php/7.1/mods-available/xdebug.ini \
&& echo "xdebug.remote_connect_back=0" >> /etc/php/7.1/mods-available/xdebug.ini \
&& echo "xdebug.idekey=docker" >> /etc/php/7.1/mods-available/xdebug.ini
Error:
E: Package 'php-xdebug' has no installation candidate
/bin/sh: 1: cannot create /etc/php/7.1/mods-available/xdebug.ini: Directory nonexistent
ERROR: Service 'php' failed to build: The command '/bin/sh -c apt-get update && apt-get -y --no-install-recommends install php-xdebug && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* && echo "zend_extension=/usr/lib/php/20160303/xdebug.so" > /etc/php/7.1/mods-available/xdebug.ini && echo "xdebug.remote_enable=on" >> /etc/php/7.1/mods-available/xdebug.ini && echo "xdebug.remote_handler=dbgp" >> /etc/php/7.1/mods-available/xdebug.ini && echo "xdebug.remote_port=9000" >> /etc/php/7.1/mods-available/xdebug.ini && echo "xdebug.remote_autostart=on" >> /etc/php/7.1/mods-available/xdebug.ini && echo "xdebug.remote_connect_back=0" >> /etc/php/7.1/mods-available/xdebug.ini && echo "xdebug.idekey=docker" >> /etc/php/7.1/mods-available/xdebug.ini' returned a non-zero code: 2