Skip to content

Commit

Permalink
Fix swoole build
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Nov 5, 2018
1 parent 867c112 commit be439ed
Show file tree
Hide file tree
Showing 12 changed files with 1,319 additions and 2,294 deletions.
321 changes: 111 additions & 210 deletions Dockerfiles/mods/Dockerfile-5.2

Large diffs are not rendered by default.

361 changes: 133 additions & 228 deletions Dockerfiles/mods/Dockerfile-5.3

Large diffs are not rendered by default.

365 changes: 135 additions & 230 deletions Dockerfiles/mods/Dockerfile-5.4

Large diffs are not rendered by default.

363 changes: 132 additions & 231 deletions Dockerfiles/mods/Dockerfile-5.5

Large diffs are not rendered by default.

359 changes: 132 additions & 227 deletions Dockerfiles/mods/Dockerfile-5.6

Large diffs are not rendered by default.

359 changes: 134 additions & 225 deletions Dockerfiles/mods/Dockerfile-7.0

Large diffs are not rendered by default.

361 changes: 131 additions & 230 deletions Dockerfiles/mods/Dockerfile-7.1

Large diffs are not rendered by default.

363 changes: 130 additions & 233 deletions Dockerfiles/mods/Dockerfile-7.2

Large diffs are not rendered by default.

337 changes: 118 additions & 219 deletions Dockerfiles/mods/Dockerfile-7.3

Large diffs are not rendered by default.

327 changes: 113 additions & 214 deletions Dockerfiles/mods/Dockerfile-7.4

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions build/ansible/DOCKERFILES/Dockerfile-mods.j2
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ RUN set -x \
{% for ext in extensions_enabled %}
{# Not disabled AND not already enabled #}
{% if (('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled'])) and ('already_avail' not in extensions_available[ext] or php_version not in extensions_available[ext]['already_avail']) %}
# ---- Installing PHP Extension: {{ ext }} ----
{# ---------- Pre Command ---------- #}
{# Version specific pre-command available? #}
{% if php_version in extensions_available[ext] and 'pre' in extensions_available[ext][php_version] %}
Expand All @@ -99,20 +100,20 @@ RUN set -x \
{# ---- 1.) Builtin ---- #}
{% if extensions_available[ext][php_version]['type'] == 'builtin' %}
{% if 'configure' in extensions_available[ext][php_version] %}
&& /usr/local/bin/docker-php-ext-configure {{ ext }} {{ extensions_available[ext][php_version]['configure'] }} \
&& /usr/local/bin/docker-php-ext-configure {{ ext }} {{ extensions_available[ext][php_version]['configure'] }} >/dev/null \
{% endif %}
&& /usr/local/bin/docker-php-ext-install{% if php_version != 5.4 %} -j$(getconf _NPROCESSORS_ONLN){% endif %} {{ ext }} \
&& /usr/local/bin/docker-php-ext-install{% if php_version != 5.4 %} -j$(getconf _NPROCESSORS_ONLN){% endif %} {{ ext }} >/dev/null \
{# ---- 2.) PECL ---- #}
{% elif extensions_available[ext][php_version]['type'] == 'pecl' %}
{% if 'command' in extensions_available[ext][php_version] %}
&& {{ extensions_available[ext][php_version]['command'] }} \
{% else %}
&& pecl install {{ ext }}{% if 'version' in extensions_available[ext][php_version] %}-{{ extensions_available[ext][php_version]['version'] }}{% endif %} \
&& pecl install {{ ext }}{% if 'version' in extensions_available[ext][php_version] %}-{{ extensions_available[ext][php_version]['version'] }}{% endif %} >/dev/null\
{% endif %}
&& docker-php-ext-enable {{ ext }} \
{# ---- 3.) GIT ---- #}
{% elif extensions_available[ext][php_version]['type'] == 'git' %}
&& git clone -v {{ extensions_available[ext][php_version]['git_url'] }} /tmp/{{ ext }} \
&& git clone {{ extensions_available[ext][php_version]['git_url'] }} /tmp/{{ ext }} \
&& cd /tmp/{{ ext }} \
{% if 'git_ref' in extensions_available[ext][php_version] %}
&& git checkout {{ extensions_available[ext][php_version]['git_ref'] }} \
Expand All @@ -121,8 +122,8 @@ RUN set -x \
&& {{ extensions_available[ext][php_version]['command'] }} \
{% else %}
&& phpize \
&& ./configure {% if 'configure' in extensions_available[ext][php_version] %} {{ extensions_available[ext][php_version]['configure'] }}{% endif %} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& ./configure {% if 'configure' in extensions_available[ext][php_version] %} {{ extensions_available[ext][php_version]['configure'] }}{% endif %} >/dev/null \
&& make -j$(getconf _NPROCESSORS_ONLN) >/dev/null \
&& make install \
{% endif %}
&& docker-php-ext-enable {{ ext }} \
Expand All @@ -135,20 +136,20 @@ RUN set -x \
{# ---- 1.) Builtin ---- #}
{% if extensions_available[ext]['all']['type'] == 'builtin' %}
{% if 'configure' in extensions_available[ext]['all'] %}
&& /usr/local/bin/docker-php-ext-configure {{ ext }} {{ extensions_available[ext]['all']['configure'] }} \
&& /usr/local/bin/docker-php-ext-configure {{ ext }} {{ extensions_available[ext]['all']['configure'] }} >/dev/null \
{% endif %}
&& /usr/local/bin/docker-php-ext-install{% if php_version != 5.4 %} -j$(getconf _NPROCESSORS_ONLN){% endif %} {{ ext }} \
&& /usr/local/bin/docker-php-ext-install{% if php_version != 5.4 %} -j$(getconf _NPROCESSORS_ONLN){% endif %} {{ ext }} >/dev/null \
{# ---- 2.) PECL ---- #}
{% elif extensions_available[ext]['all']['type'] == 'pecl' %}
{% if 'command' in extensions_available[ext]['all'] %}
&& {{ extensions_available[ext]['all']['command'] }} \
{% else %}
&& pecl install {{ ext }}{% if 'version' in extensions_available[ext]['all'] %}-{{ extensions_available[ext]['all']['version'] }}{% endif %} \
&& pecl install {{ ext }}{% if 'version' in extensions_available[ext]['all'] %}-{{ extensions_available[ext]['all']['version'] }}{% endif %} >/dev/null \
{% endif %}
&& docker-php-ext-enable {{ ext }} \
{# ---- 3.) GIT ---- #}
{% elif extensions_available[ext]['all']['type'] == 'git' %}
&& git clone -v {{ extensions_available[ext]['all']['git_url'] }} /tmp/{{ ext }} \
&& git clone {{ extensions_available[ext]['all']['git_url'] }} /tmp/{{ ext }} \
&& cd /tmp/{{ ext }} \
{% if 'git_ref' in extensions_available[ext]['all'] %}
&& git checkout {{ extensions_available[ext]['all']['git_ref'] }} \
Expand All @@ -157,8 +158,8 @@ RUN set -x \
&& {{ extensions_available[ext]['all']['command'] }} \
{% else %}
&& phpize \
&& ./configure {% if 'configure' in extensions_available[ext]['all'] %} {{ extensions_available[ext]['all']['configure'] }}{% endif %} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& ./configure {% if 'configure' in extensions_available[ext]['all'] %} {{ extensions_available[ext]['all']['configure'] }}{% endif %} >/dev/null \
&& make -j$(getconf _NPROCESSORS_ONLN) >/dev/null \
&& make install \
{% endif %}
&& docker-php-ext-enable {{ ext }} \
Expand All @@ -167,6 +168,10 @@ RUN set -x \
&& {{ extensions_available[ext]['all']['command'] }} \
{% endif %}
{% endif %}
{# Only delete files for extensions we've actually installed, not those that were already available by default #}
&& (rm -rf /usr/local/lib/php/test/{{ ext }} || true) \
&& (rm -rf /usr/local/lib/php/doc/{{ ext }} || true) \
\
{% endif %}
{# Ensure modules that are not disabled have an appropriate ini directive and are loaded #}
{% if ('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled']) %}
Expand All @@ -175,12 +180,9 @@ RUN set -x \
{% elif 'all' in extensions_available[ext] and 'load_ext' in extensions_available[ext]['all'] %}
&& if [ ! -f "/usr/local/etc/php/conf.d/docker-php-ext-{{ ext }}.ini" ]; then echo "extenstion={{ extensions_available[ext]['all']['load_ext'] }}" > "/usr/local/etc/php/conf.d/docker-php-ext-{{ ext }}.ini"; fi \
{% endif %}
\
&& (rm -rf /usr/local/lib/php/test/{{ ext }} || true) \
&& (rm -rf /usr/local/lib/php/doc/{{ ext }} || true) \
&& chmod +x "$(php -r 'echo ini_get("extension_dir");')"/* \
{% endif %}
{% endfor %}
&& chmod +x "$(php -r 'echo ini_get("extension_dir");')"/* \
&& rm -rf /tmp/* \
\
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ${BUILD_DEPS} \
Expand Down
63 changes: 32 additions & 31 deletions build/ansible/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ extensions_available:
run_dep: [librabbitmq1]
all:
type: pecl
command: echo "/usr" | pecl install amqp
command: echo "/usr" | pecl install amqp >/dev/null
build_dep: [librabbitmq-dev]
run_dep: [librabbitmq4]
apcu:
Expand Down Expand Up @@ -843,7 +843,7 @@ extensions_available:
enchant:
5.2:
type: pecl
command: echo "/usr" | pecl install enchant
command: echo "/usr" | pecl install enchant >/dev/null
all:
type: builtin
build_dep: [libenchant-dev]
Expand Down Expand Up @@ -997,7 +997,7 @@ extensions_available:
EXTENSION_DIR="$( php -i | grep ^extension_dir | awk -F '=>' '{print $2}' | xargs )" \
&& if [ ! -d "${EXTENSION_DIR}" ]; then mkdir -p "${EXTENSION_DIR}"; fi \
&& curl https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -L -o ioncube.tar.gz \
&& tar xvfz ioncube.tar.gz \
&& tar xvfz ioncube.tar.gz >/dev/null \
&& cd ioncube \
&& cp "ioncube_loader_lin_{{ php_version }}.so" "${EXTENSION_DIR}/ioncube.so" \
&& cd ../ \
Expand Down Expand Up @@ -1071,12 +1071,12 @@ extensions_available:
type: git
git_url: https://github.com/php-memcached-dev/php-memcached
git_ref: master
command: phpize && ./configure --enable-memcached && make -j$(getconf _NPROCESSORS_ONLN) && make install
command: phpize && ./configure --enable-memcached >/dev/null && make -j$(getconf _NPROCESSORS_ONLN) >/dev/null && make install
7.4:
type: git
git_url: https://github.com/php-memcached-dev/php-memcached
git_ref: master
command: phpize && ./configure --enable-memcached && make -j$(getconf _NPROCESSORS_ONLN) && make install
command: phpize && ./configure --enable-memcached >/dev/null && make -j$(getconf _NPROCESSORS_ONLN) >/dev/null && make install
all:
type: pecl
build_dep: [zlib1g-dev, libmemcached-dev]
Expand All @@ -1085,10 +1085,10 @@ extensions_available:
disabled: [7.0, 7.1, 7.2, 7.3, 7.4] # Deprecated
5.2:
type: pecl
command: yes | pecl install mongo-1.5.8
command: yes | pecl install mongo-1.5.8 >/dev/null
all:
type: pecl
command: yes | pecl install mongo
command: yes | pecl install mongo > /dev/null
build_dep: [libssl-dev, libsasl2-dev]
mongodb:
disabled: [5.2]
Expand Down Expand Up @@ -1143,13 +1143,13 @@ extensions_available:
opcache:
5.2:
type: pecl
command: pecl install zendopcache
command: pecl install zendopcache >/dev/null
5.3:
type: pecl
command: pecl install zendopcache
command: pecl install zendopcache >/dev/null
5.4:
type: pecl
command: pecl install zendopcache
command: pecl install zendopcache >/dev/null
all:
type: builtin
openssl:
Expand Down Expand Up @@ -1210,12 +1210,12 @@ extensions_available:
type: git
git_url: https://github.com/phalcon/cphalcon
git_ref: phalcon-v2.0.9
command: cd build && ./install
command: cd build && ./install >/dev/null
5.4:
type: git
git_url: https://github.com/phalcon/cphalcon
git_ref: phalcon-v2.0.13
command: cd build && ./install
command: cd build && ./install >/dev/null
# 7.3:
# type: git
# git_url: https://github.com/phalcon/cphalcon
Expand All @@ -1226,7 +1226,7 @@ extensions_available:
type: git
git_url: https://github.com/phalcon/cphalcon
git_ref: $(git for-each-ref --format='%(*creatordate:raw)%(creatordate:raw) %(refname)' refs/tags | sort -n | tail -1 | sed 's/^.*tags\///g')
command: cd build && ./install
command: cd build && ./install >/dev/null
phar:
# https://github.com/docker-library/php/issues/618
disabled: [5.6, 7.0] # TODO: Currently disabled due to bug in built
Expand Down Expand Up @@ -1270,8 +1270,8 @@ extensions_available:
&& sed -i'' 's/ZEND_ACC_CTOR | //g' redis.c \
&& sed -i'' 's/ZEND_ACC_DTOR | //g' redis.c \
&& sed -i'' 's/ZEND_ACC_CTOR | //g' redis_cluster.c \
&& ./configure \
&& make -j8 \
&& ./configure >/dev/null \
&& make -j$(getconf _NPROCESSORS_ONLN) >/dev/null \
&& make install \
all:
type: pecl
Expand Down Expand Up @@ -1336,21 +1336,19 @@ extensions_available:
5.6:
type: pecl
version: 1.9.23
7.0:
type: pecl
version: 2.2.0
7.3:
type: git
git_url: https://github.com/swoole/swoole-src
git_ref: master
command: |
git checkout $(git describe --abbrev=0 --tags) \
&& git submodule update --init --recursive \
&& cd thirdparty/hiredis \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& cd ../nghttp2 \
&& cmake . \
#`&& cd thirdparty/hiredis` \
#`&& make -j$(getconf _NPROCESSORS_ONLN) >/dev/null` \
#`&& make install` \
#`&& cd ../../` \
&& cd thirdparty/nghttp2 \
&& cmake . >/dev/null \
&& make install \
&& ldconfig \
&& cd ../.. \
Expand All @@ -1375,7 +1373,8 @@ extensions_available:
#`--enable-http2` \
#`--enable-sockets` \
#`--with-libpq-dir=/usr/include/postgresql/libpq/` \
&& make -j$(getconf _NPROCESSORS_ONLN) \
>/dev/null \
&& make -j$(getconf _NPROCESSORS_ONLN) >/dev/null \
&& make install \
run_dep: [libnghttp2-14, libhiredis0.13]
build_dep: [libnghttp2-dev, libssl-dev, libhiredis-dev, cmake]
Expand All @@ -1386,17 +1385,18 @@ extensions_available:
command: |
git checkout $(git describe --abbrev=0 --tags) \
&& git submodule update --init --recursive \
&& cd thirdparty/hiredis \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& cd ../nghttp2 \
&& cmake . \
#`&& cd thirdparty/hiredis` \
#`&& make -j$(getconf _NPROCESSORS_ONLN) >/dev/null` \
#`&& make install` \
#`&& cd ../../` \
&& cd thirdparty/nghttp2 \
&& cmake . >/dev/null \
&& make install \
&& ldconfig \
&& cd ../.. \
&& phpize \
&& ./configure \
--enable-async-redis \
#`--enable-async-redis` \
--enable-openssl \
--enable-thread \
--enable-swoole \
Expand All @@ -1415,7 +1415,8 @@ extensions_available:
#`--enable-http2` \
#`--enable-sockets` \
#`--with-libpq-dir=/usr/include/postgresql/libpq/` \
&& make -j$(getconf _NPROCESSORS_ONLN) \
>/dev/null \
&& make -j$(getconf _NPROCESSORS_ONLN) >/dev/null \
&& make install \
run_dep: [libnghttp2-14, libhiredis0.13]
build_dep: [libnghttp2-dev, libssl-dev, libhiredis-dev, cmake]
Expand Down

0 comments on commit be439ed

Please sign in to comment.