Created
September 8, 2021 13:39
-
-
Save ralphschindler/05ef2bcb5aaf640bcb07957fbec20c56 to your computer and use it in GitHub Desktop.
Build php xdebug from scratch in a Docker container, with laravel app
This file contains 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 ubuntu:20.10 | |
RUN mkdir /app | |
WORKDIR /app | |
RUN apt-get update && DEBIAN_FRONTEND=noninteractive \ | |
apt-get install -qqy --no-install-recommends \ | |
ca-certificates \ | |
valgrind \ | |
gdb \ | |
build-essential \ | |
net-tools \ | |
autoconf \ | |
bison \ | |
re2c \ | |
libxml2-dev \ | |
libcurl4-openssl-dev \ | |
libjpeg-dev \ | |
libpng-dev \ | |
libxpm-dev \ | |
libmysqlclient-dev \ | |
libpq-dev \ | |
libicu-dev \ | |
libfreetype6-dev \ | |
libldap2-dev \ | |
libxslt-dev \ | |
libssl-dev \ | |
libldb-dev \ | |
libsqlite3-dev \ | |
libonig-dev \ | |
nano \ | |
git \ | |
wget \ | |
unzip \ | |
less \ | |
curl \ | |
&& rm -rf /var/lib/apt/lists/* | |
# I am grabbing a copy of master, not checking it out b/c it is HUGE, and I dont want the image to be that large | |
RUN wget -q https://github.com/php/php-src/archive/master.zip \ | |
&& unzip master.zip \ | |
&& rm master.zip \ | |
&& cd php-src-master \ | |
&& ./buildconf \ | |
&& ./configure --enable-debug --prefix=/app/php/ --with-openssl --with-zlib --enable-mbstring \ | |
&& make -j4 \ | |
&& make install | |
RUN git clone https://github.com/xdebug/xdebug.git \ | |
&& cd xdebug \ | |
&& /app/php/bin/phpize \ | |
&& ./configure --with-php-config=/app/php/bin/php-config \ | |
&& make \ | |
&& make install | |
ENV PATH="$PATH:/app/php/bin" | |
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/app/php/bin --filename=composer | |
RUN composer --quiet create-project --no-dev --ignore-platform-reqs laravel/laravel test-laravel-app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment