Last active
April 28, 2024 12:12
-
-
Save mingalevme/0e5dee61d462864f8e05647811bf9376 to your computer and use it in GitHub Desktop.
PHP Docker + Xdebug + Composer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.1 | |
RUN apt-get -y update && \ | |
apt-get install -y zip libzip-dev && docker-php-ext-install zip && \ | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ | |
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ | |
php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \ | |
php -r "unlink('composer-setup.php');" && \ | |
pecl install xdebug-2.9.7 && docker-php-ext-enable xdebug | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.4 | |
RUN apt-get -y update && \ | |
apt-get install -y zip libzip-dev && docker-php-ext-install zip && \ | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ | |
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ | |
php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \ | |
php -r "unlink('composer-setup.php');" && \ | |
pecl install xdebug && docker-php-ext-enable xdebug | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment