<commit_before>FROM 1maa/alpine:3.11

ENV PHP_VERSION=master
ENV GEARMAN_VERSION=2.0.6
ENV MAXMINDDB_VERSION=1.6.0
ENV MEMCACHED_VERSION=3.1.5
ENV XHPROF_VERSION=5.0.2

ENV CFLAGS="-Os -march=x86-64"
ENV LDFLAGS="-s"

WORKDIR /tmp

ADD https://github.com/php/php-src/archive/${PHP_VERSION}.tar.gz .

RUN apk add --no-cache \
    # generic dependencies for compiling the source
    autoconf \
    automake \
    build-base \
    bison \
    file \
    flex \
    libtool \
    re2c \

    upx \

    # dependencies for building specific extensions
    argon2-dev \
    bzip2-dev \
    curl-dev \
    gd-dev \
    gearman-dev@edge-testing \
    gmp-dev \
    gpgme-dev \
    libevent-dev \
    libffi-dev \
    libgcrypt-dev \
    libmaxminddb-dev \
    libmemcached-dev \
    libpng-dev \
    librdkafka-dev \
    libsodium-dev \
    libssh2-dev \
    libuv-dev \
    libxml2-dev \
    libxslt-dev \
    libzip-dev \
    oniguruma-dev \
    openssl-dev \
    postgresql-dev \
    rabbitmq-c-dev \
    readline-dev \
    sqlite-dev \
 && tar zxof ${PHP_VERSION}.tar.gz \
 && cd php-src-${PHP_VERSION} \
 && ./buildconf \
 && ./configure \
    EXTENSION_DIR="/usr/lib/php" \

    --prefix=/usr \
    --sysconfdir=/etc/php/cli \
    --with-config-file-path=/etc/php/cli \
    --with-config-file-scan-dir=/etc/php/cli/conf.d \

    --enable-cli \
    --disable-fpm \
    --disable-cgi \
    --disable-phpdbg \

    --enable-bcmath \
    --enable-calendar \
    --enable-exif \
    --enable-ftp \
    --enable-gd \
    --enable-mbstring \
    --enable-opcache \
    --enable-pcntl \
    --enable-shmop \
    --enable-soap \
    --enable-sockets \

    --with-bz2 \
    --with-curl \
    --with-ffi \
    --with-gmp \
    --with-mysqli \
    --with-openssl \
    --with-password-argon2 \
    --with-pdo-mysql \
    --with-pdo-pgsql \
    --with-pear \
    --with-pgsql \
    --with-readline \
    --with-sodium \
    --with-xmlrpc \
    --with-xsl \
    --with-zip \
    --with-zlib \
 && make -j$(nproc) \
 && make install

# RUN wget -q https://github.com/tideways/php-xhprof-extension/archive/v${XHPROF_VERSION}.tar.gz \
#  && tar zxof v${XHPROF_VERSION}.tar.gz \
#  && cd ./php-xhprof-extension-${XHPROF_VERSION} \
#  && phpize \
#  && ./configure \
#  && make \
#  && make install

# RUN wget -q https://github.com/maxmind/MaxMind-DB-Reader-php/archive/v${MAXMINDDB_VERSION}.tar.gz \
#  && tar zxof v${MAXMINDDB_VERSION}.tar.gz \
#  && cd MaxMind-DB-Reader-php-${MAXMINDDB_VERSION}/ext \
#  && phpize \
#  && ./configure \
#  && make \
#  && make install

# RUN wget -q https://github.com/php/pecl-networking-gearman/archive/gearman-${GEARMAN_VERSION}.tar.gz \
#  && tar zxof gearman-${GEARMAN_VERSION}.tar.gz \
#  && cd pecl-networking-gearman-gearman-${GEARMAN_VERSION} \
#  && phpize \
#  && ./configure \
#  && make \
#  && make install

RUN sed -i "s#option\[name\]#option\['name'\]#" /usr/lib/php/PEAR/Builder.php \
 && pecl channel-update pecl.php.net \
 && pecl install \
    igbinary \<commit_msg>reportedly this has been fixed upstream<commit_after>FROM 1maa/alpine:3.11

ENV PHP_VERSION=master
ENV GEARMAN_VERSION=2.0.6
ENV MAXMINDDB_VERSION=1.6.0
ENV MEMCACHED_VERSION=3.1.5
ENV XHPROF_VERSION=5.0.2

ENV CFLAGS="-Os -march=x86-64"
ENV LDFLAGS="-s"

WORKDIR /tmp

ADD https://github.com/php/php-src/archive/${PHP_VERSION}.tar.gz .

RUN apk add --no-cache \
    # generic dependencies for compiling the source
    autoconf \
    automake \
    build-base \
    bison \
    file \
    flex \
    libtool \
    re2c \

    upx \

    # dependencies for building specific extensions
    argon2-dev \
    bzip2-dev \
    curl-dev \
    gd-dev \
    gearman-dev@edge-testing \
    gmp-dev \
    gpgme-dev \
    libevent-dev \
    libffi-dev \
    libgcrypt-dev \
    libmaxminddb-dev \
    libmemcached-dev \
    libpng-dev \
    librdkafka-dev \
    libsodium-dev \
    libssh2-dev \
    libuv-dev \
    libxml2-dev \
    libxslt-dev \
    libzip-dev \
    oniguruma-dev \
    openssl-dev \
    postgresql-dev \
    rabbitmq-c-dev \
    readline-dev \
    sqlite-dev \
 && tar zxof ${PHP_VERSION}.tar.gz \
 && cd php-src-${PHP_VERSION} \
 && ./buildconf \
 && ./configure \
    EXTENSION_DIR="/usr/lib/php" \

    --prefix=/usr \
    --sysconfdir=/etc/php/cli \
    --with-config-file-path=/etc/php/cli \
    --with-config-file-scan-dir=/etc/php/cli/conf.d \

    --enable-cli \
    --disable-fpm \
    --disable-cgi \
    --disable-phpdbg \

    --enable-bcmath \
    --enable-calendar \
    --enable-exif \
    --enable-ftp \
    --enable-gd \
    --enable-mbstring \
    --enable-opcache \
    --enable-pcntl \
    --enable-shmop \
    --enable-soap \
    --enable-sockets \

    --with-bz2 \
    --with-curl \
    --with-ffi \
    --with-gmp \
    --with-mysqli \
    --with-openssl \
    --with-password-argon2 \
    --with-pdo-mysql \
    --with-pdo-pgsql \
    --with-pear \
    --with-pgsql \
    --with-readline \
    --with-sodium \
    --with-xmlrpc \
    --with-xsl \
    --with-zip \
    --with-zlib \
 && make -j$(nproc) \
 && make install

# RUN wget -q https://github.com/tideways/php-xhprof-extension/archive/v${XHPROF_VERSION}.tar.gz \
#  && tar zxof v${XHPROF_VERSION}.tar.gz \
#  && cd ./php-xhprof-extension-${XHPROF_VERSION} \
#  && phpize \
#  && ./configure \
#  && make \
#  && make install

# RUN wget -q https://github.com/maxmind/MaxMind-DB-Reader-php/archive/v${MAXMINDDB_VERSION}.tar.gz \
#  && tar zxof v${MAXMINDDB_VERSION}.tar.gz \
#  && cd MaxMind-DB-Reader-php-${MAXMINDDB_VERSION}/ext \
#  && phpize \
#  && ./configure \
#  && make \
#  && make install

# RUN wget -q https://github.com/php/pecl-networking-gearman/archive/gearman-${GEARMAN_VERSION}.tar.gz \
#  && tar zxof gearman-${GEARMAN_VERSION}.tar.gz \
#  && cd pecl-networking-gearman-gearman-${GEARMAN_VERSION} \
#  && phpize \
#  && ./configure \
#  && make \
#  && make install

RUN pecl channel-update pecl.php.net \
 && pecl install \
    igbinary \
{'fraction_non_alphanumeric': 0.17316090023513606, 'fraction_numerical': 0.009069533087000335, 'mean_word_length': 1.8893740902474527, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5286117', 'n_tokens_mistral': 2455, 'n_tokens_neox': 2364, 'n_words': 345}