mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2026-01-09 17:41:14 +00:00
Fix build pipeline
This commit is contained in:
@@ -44,9 +44,8 @@ RUN set -x \
|
||||
### Upgrade (install ps)
|
||||
###
|
||||
RUN set -x \
|
||||
&& apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y procps \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
@@ -77,10 +76,20 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
|
||||
### Verify
|
||||
###
|
||||
RUN set -x \
|
||||
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^{{ php_version }}' \
|
||||
&& /usr/local/sbin/php-fpm --test \
|
||||
\
|
||||
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
|
||||
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
|
||||
\
|
||||
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
|
||||
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
|
||||
&& rm -f /usr/local/etc/php/php.ini
|
||||
|
||||
|
||||
{% endif %}
|
||||
|
||||
@@ -18,43 +18,56 @@ LABEL \
|
||||
### Envs
|
||||
###
|
||||
ENV BUILD_DEPS \
|
||||
{# Loop over enabled build dependencies #}
|
||||
{% for ext in extensions_enabled %}
|
||||
{# Not disabled #}
|
||||
{% if ('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled']) %}
|
||||
{# Version specific build dependency available? #}
|
||||
{% if php_version in extensions_available[ext] and 'build_dep' in extensions_available[ext][php_version] %}
|
||||
{% for build_dep in extensions_available[ext][php_version]['build_dep'] %}
|
||||
{# Loop over enabled build dependencies -#}
|
||||
{%- set build_deps = [] -%}
|
||||
{%- for ext in extensions_enabled -%}
|
||||
{#- Not disabled AND not already available by default -#}
|
||||
{%- 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']) -%}
|
||||
{#- Version specific build dependency available? -#}
|
||||
{%- if php_version in extensions_available[ext] and 'build_dep' in extensions_available[ext][php_version] -%}
|
||||
{%- for build_dep in extensions_available[ext][php_version]['build_dep'] -%}
|
||||
{#- Append build dependencies to our array -#}
|
||||
{{- build_deps.append(build_dep) -}}
|
||||
{%- endfor -%}
|
||||
{#- Generic build dependency available? -#}
|
||||
{%- elif 'all' in extensions_available[ext] and 'build_dep' in extensions_available[ext]['all'] -%}
|
||||
{%- for build_dep in extensions_available[ext]['all']['build_dep'] -%}
|
||||
{#- Append build dependencies to our array -#}
|
||||
{{- build_deps.append(build_dep) -}}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{% for build_dep in build_deps | unique | sort %}
|
||||
{{ build_dep }} \
|
||||
{% endfor %}
|
||||
{# Generic build dependency available? #}
|
||||
{% elif 'all' in extensions_available[ext] and 'build_dep' in extensions_available[ext]['all'] %}
|
||||
{% for build_dep in extensions_available[ext]['all']['build_dep'] %}
|
||||
{{ build_dep }} \
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
ca-certificates \
|
||||
git
|
||||
|
||||
ENV RUN_DEPS \
|
||||
{# Loop over enabled run-time dependencies #}
|
||||
{% for ext in extensions_enabled %}
|
||||
{# Not disabled #}
|
||||
{% if ('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled']) %}
|
||||
{# Version specific run-time dependency available? #}
|
||||
{% if php_version in extensions_available[ext] and 'run_dep' in extensions_available[ext][php_version] %}
|
||||
{% for run_dep in extensions_available[ext][php_version]['run_dep'] %}
|
||||
{# Loop over enabled run-time dependencies -#}
|
||||
{%- set run_deps = [] -%}
|
||||
{%- for ext in extensions_enabled -%}
|
||||
{#- Not disabled -#}
|
||||
{%- if ('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled']) -%}
|
||||
{#- Version specific run-time dependency available? -#}
|
||||
{%- if php_version in extensions_available[ext] and 'run_dep' in extensions_available[ext][php_version] -%}
|
||||
{%- for run_dep in extensions_available[ext][php_version]['run_dep'] -%}
|
||||
{#- Append run dependencies to our array -#}
|
||||
{{- run_deps.append(run_dep) -}}
|
||||
{%- endfor -%}
|
||||
{#- Generic run-time dependency available? -#}
|
||||
{%- elif 'all' in extensions_available[ext] and 'run_dep' in extensions_available[ext]['all'] -%}
|
||||
{%- for run_dep in extensions_available[ext]['all']['run_dep'] -%}
|
||||
{#- Append run dependencies to our array -#}
|
||||
{{- run_deps.append(run_dep) -}}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{% for run_dep in run_deps | unique | sort %}
|
||||
{{ run_dep }} \
|
||||
{% endfor %}
|
||||
{# Generic run-time dependency available? #}
|
||||
{% elif 'all' in extensions_available[ext] and 'run_dep' in extensions_available[ext]['all'] %}
|
||||
{% for run_dep in extensions_available[ext]['all']['run_dep'] %}
|
||||
{{ run_dep }} \
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
ca-certificates
|
||||
|
||||
@@ -63,108 +76,113 @@ ENV RUN_DEPS \
|
||||
### Install
|
||||
###
|
||||
RUN set -x \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
|
||||
${BUILD_DEPS} \
|
||||
\
|
||||
\
|
||||
{# Loop over enabled extensions #}
|
||||
{% for ext in extensions_enabled %}
|
||||
{# Not disabled #}
|
||||
{% if ('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled']) %}
|
||||
{# ---------- Pre Command ---------- #}
|
||||
{# Version specific pre-command available? #}
|
||||
{% if php_version in extensions_available[ext] and 'pre' in extensions_available[ext][php_version] %}
|
||||
{# 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']) %}
|
||||
{# ---------- Pre Command ---------- #}
|
||||
{# Version specific pre-command available? #}
|
||||
{% if php_version in extensions_available[ext] and 'pre' in extensions_available[ext][php_version] %}
|
||||
&& {{ extensions_available[ext][php_version]['pre'] }} \
|
||||
{# Generic pre-command available? #}
|
||||
{% elif 'all' in extensions_available[ext] and 'pre' in extensions_available[ext]['all'] %}
|
||||
{# Generic pre-command available? #}
|
||||
{% elif 'all' in extensions_available[ext] and 'pre' in extensions_available[ext]['all'] %}
|
||||
&& {{ extensions_available[ext]['all']['pre'] }} \
|
||||
{% endif %}
|
||||
{# ---------- Installation (specific) ---------- #}
|
||||
{% if php_version in extensions_available[ext] and 'type' in extensions_available[ext][php_version] %}
|
||||
{# ---- 1.) Builtin ---- #}
|
||||
{% if extensions_available[ext][php_version]['type'] == 'builtin' %}
|
||||
{% if 'configure' in extensions_available[ext][php_version] %}
|
||||
{% endif %}
|
||||
{# ---------- Installation (specific) ---------- #}
|
||||
{% if php_version in extensions_available[ext] and 'type' in extensions_available[ext][php_version] %}
|
||||
{# ---- 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'] }} \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
&& /usr/local/bin/docker-php-ext-install{% if php_version != 5.4 %} -j$(getconf _NPROCESSORS_ONLN){% endif %} {{ ext }} \
|
||||
{# ---- 2.) PECL ---- #}
|
||||
{% elif extensions_available[ext][php_version]['type'] == 'pecl' %}
|
||||
{% if 'command' in extensions_available[ext][php_version] %}
|
||||
{# ---- 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 %}
|
||||
{% else %}
|
||||
&& pecl install {{ ext }}{% if 'version' in extensions_available[ext][php_version] %}-{{ extensions_available[ext][php_version]['version'] }}{% endif %} \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
&& docker-php-ext-enable {{ ext }} \
|
||||
{# ---- 3.) GIT ---- #}
|
||||
{% elif extensions_available[ext][php_version]['type'] == 'git' %}
|
||||
{# ---- 3.) GIT ---- #}
|
||||
{% elif extensions_available[ext][php_version]['type'] == 'git' %}
|
||||
&& git clone -v {{ extensions_available[ext][php_version]['git_url'] }} /tmp/{{ ext }} \
|
||||
&& cd /tmp/{{ ext }} \
|
||||
{% if 'git_ref' in extensions_available[ext][php_version] %}
|
||||
{% if 'git_ref' in extensions_available[ext][php_version] %}
|
||||
&& git checkout {{ extensions_available[ext][php_version]['git_ref'] }} \
|
||||
{% endif %}
|
||||
{% if 'command' in extensions_available[ext][php_version] %}
|
||||
{% endif %}
|
||||
{% if 'command' in extensions_available[ext][php_version] %}
|
||||
&& {{ extensions_available[ext][php_version]['command'] }} \
|
||||
{% else %}
|
||||
{% else %}
|
||||
&& phpize \
|
||||
&& ./configure {% if 'configure' in extensions_available[ext][php_version] %} {{ extensions_available[ext][php_version]['configure'] }}{% endif %} \
|
||||
&& make -j$(getconf _NPROCESSORS_ONLN) \
|
||||
&& make install \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
&& docker-php-ext-enable {{ ext }} \
|
||||
&& cd / && rm -rf /tmp/{{ ext }} \
|
||||
{# ---- 4.) CUSTOM ---- #}
|
||||
{% elif extensions_available[ext][php_version]['type'] == 'custom' %}
|
||||
{# ---- 4.) CUSTOM ---- #}
|
||||
{% elif extensions_available[ext][php_version]['type'] == 'custom' %}
|
||||
&& {{ extensions_available[ext][php_version]['command'] }} \
|
||||
{% endif %}
|
||||
{# ---------- Installation (generic) ---------- #}
|
||||
{% elif 'all' in extensions_available[ext] and 'type' in extensions_available[ext]['all'] %}
|
||||
{# ---- 1.) Builtin ---- #}
|
||||
{% if extensions_available[ext]['all']['type'] == 'builtin' %}
|
||||
{% if 'configure' in extensions_available[ext]['all'] %}
|
||||
{% endif %}
|
||||
{# ---------- Installation (generic) ---------- #}
|
||||
{% elif 'all' in extensions_available[ext] and 'type' in extensions_available[ext]['all'] %}
|
||||
{# ---- 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'] }} \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
&& /usr/local/bin/docker-php-ext-install{% if php_version != 5.4 %} -j$(getconf _NPROCESSORS_ONLN){% endif %} {{ ext }} \
|
||||
{# ---- 2.) PECL ---- #}
|
||||
{% elif extensions_available[ext]['all']['type'] == 'pecl' %}
|
||||
{% if 'command' in extensions_available[ext]['all'] %}
|
||||
{# ---- 2.) PECL ---- #}
|
||||
{% elif extensions_available[ext]['all']['type'] == 'pecl' %}
|
||||
{% if 'command' in extensions_available[ext]['all'] %}
|
||||
&& {{ extensions_available[ext]['all']['command'] }} \
|
||||
{% else %}
|
||||
{% else %}
|
||||
&& pecl install {{ ext }}{% if 'version' in extensions_available[ext]['all'] %}-{{ extensions_available[ext]['all']['version'] }}{% endif %} \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
&& docker-php-ext-enable {{ ext }} \
|
||||
{# ---- 3.) GIT ---- #}
|
||||
{% elif extensions_available[ext]['all']['type'] == 'git' %}
|
||||
{# ---- 3.) GIT ---- #}
|
||||
{% elif extensions_available[ext]['all']['type'] == 'git' %}
|
||||
&& git clone -v {{ extensions_available[ext]['all']['git_url'] }} /tmp/{{ ext }} \
|
||||
&& cd /tmp/{{ ext }} \
|
||||
{% if 'git_ref' in extensions_available[ext]['all'] %}
|
||||
{% if 'git_ref' in extensions_available[ext]['all'] %}
|
||||
&& git checkout {{ extensions_available[ext]['all']['git_ref'] }} \
|
||||
{% endif %}
|
||||
{% if 'command' in extensions_available[ext]['all'] %}
|
||||
{% endif %}
|
||||
{% if 'command' in extensions_available[ext]['all'] %}
|
||||
&& {{ extensions_available[ext]['all']['command'] }} \
|
||||
{% else %}
|
||||
{% else %}
|
||||
&& phpize \
|
||||
&& ./configure {% if 'configure' in extensions_available[ext]['all'] %} {{ extensions_available[ext]['all']['configure'] }}{% endif %} \
|
||||
&& make -j$(getconf _NPROCESSORS_ONLN) \
|
||||
&& make install \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
&& docker-php-ext-enable {{ ext }} \
|
||||
&& cd / && rm -rf /tmp/{{ ext }} \
|
||||
{# ---- 4.) CUSTOM ---- #}
|
||||
{% elif extensions_available[ext]['all']['type'] == 'custom' %}
|
||||
{# ---- 4.) CUSTOM ---- #}
|
||||
{% elif extensions_available[ext]['all']['type'] == 'custom' %}
|
||||
&& {{ extensions_available[ext]['all']['command'] }} \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% 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']) %}
|
||||
{% if php_version in extensions_available[ext] and 'load_ext' in extensions_available[ext][php_version] %}
|
||||
&& if [ ! -f "/usr/local/etc/php/conf.d/docker-php-ext-{{ ext }}.ini" ]; then echo "extension={{ extensions_available[ext][php_version]['load_ext'] }}" > "/usr/local/etc/php/conf.d/docker-php-ext-{{ ext }}.ini"; fi \
|
||||
{% 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 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
\
|
||||
\
|
||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \
|
||||
${BUILD_DEPS} \
|
||||
\
|
||||
\
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
${RUN_DEPS} \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ${BUILD_DEPS} \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests ${RUN_DEPS} \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& update-ca-certificates \
|
||||
&& sh -c "find /usr/local -type f -perm /u+x -exec strip --strip-all '{}' + || true"
|
||||
@@ -175,25 +193,34 @@ RUN set -x \
|
||||
### Verify
|
||||
###
|
||||
RUN set -x \
|
||||
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^{{ php_version }}' \
|
||||
&& /usr/local/sbin/php-fpm --test \
|
||||
\
|
||||
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi
|
||||
|
||||
RUN set -x \
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
|
||||
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
|
||||
\
|
||||
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
|
||||
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
|
||||
&& rm -f /usr/local/etc/php/php.ini \
|
||||
\
|
||||
{% for ext in extensions_enabled %}
|
||||
{# Not disabled #}
|
||||
{% if ('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled']) %}
|
||||
{% if ext == 'opcache' %}
|
||||
{#- Not disabled #}
|
||||
{%- if ('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled']) %}
|
||||
{%- if ext == 'opcache' %}
|
||||
&& php -m | grep -oiE '^Zend Opcache$' \
|
||||
&& php-fpm -m | grep -oiE '^Zend Opcache$' \
|
||||
{% elif ext == 'ioncube' %}
|
||||
{# Not enabled #}
|
||||
{% else %}
|
||||
{# #}
|
||||
{%- elif ext not in ['ioncube'] %}
|
||||
&& php -m | grep -oiE '^{{ ext }}$' \
|
||||
&& php-fpm -m | grep -oiE '^{{ ext }}$' \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{# #}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{% endfor %}
|
||||
&& true
|
||||
|
||||
|
||||
@@ -18,15 +18,16 @@ LABEL \
|
||||
### Install
|
||||
###
|
||||
RUN set -x \
|
||||
&& apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
|
||||
locales-all \
|
||||
postfix \
|
||||
postfix-pcre \
|
||||
rsyslog \
|
||||
socat \
|
||||
supervisor \
|
||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
\
|
||||
&& rm -rf /etc/supervisor* \
|
||||
@@ -40,10 +41,20 @@ RUN set -x \
|
||||
### Verify
|
||||
###
|
||||
RUN set -x \
|
||||
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^{{ php_version }}' \
|
||||
&& /usr/local/sbin/php-fpm --test \
|
||||
\
|
||||
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
|
||||
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
|
||||
\
|
||||
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
|
||||
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
|
||||
&& rm -f /usr/local/etc/php/php.ini
|
||||
|
||||
|
||||
{% endif %}
|
||||
|
||||
@@ -24,38 +24,45 @@ ENV BASH_PROFILE=".bashrc"
|
||||
### Install Tools
|
||||
###
|
||||
RUN set -x \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
|
||||
dirmngr \
|
||||
gnupg \
|
||||
{% for repo in apt_repositories_enabled %}
|
||||
{# Not disabled #}
|
||||
{% if ('disabled' not in apt_repositories_available[repo]) or (php_version not in apt_repositories_available[repo]['disabled']) %}
|
||||
{# Version specific pre-command available? #}
|
||||
{% if php_version in apt_repositories_available[repo] and 'pre' in apt_repositories_available[repo][php_version] %}
|
||||
{% for repo in apt_repositories_enabled -%}
|
||||
{#- Not disabled -#}
|
||||
{%- if ('disabled' not in apt_repositories_available[repo]) or (php_version not in apt_repositories_available[repo]['disabled']) -%}
|
||||
{#- Version specific pre-command available? -#}
|
||||
{%- if php_version in apt_repositories_available[repo] and 'pre' in apt_repositories_available[repo][php_version] %}
|
||||
&& {{ apt_repositories_available[repo][php_version]['pre'] }} \
|
||||
{# Generic pre-command available? #}
|
||||
{% elif 'all' in apt_repositories_available[repo] and 'pre' in apt_repositories_available[repo]['all'] %}
|
||||
{# #}
|
||||
{#- Generic pre-command available? -#}
|
||||
{%- elif 'all' in apt_repositories_available[repo] and 'pre' in apt_repositories_available[repo]['all'] %}
|
||||
&& {{ apt_repositories_available[repo]['all']['pre'] }} \
|
||||
{% endif %}
|
||||
{# Version specific key available? #}
|
||||
{% if php_version in apt_repositories_available[repo] and 'key' in apt_repositories_available[repo][php_version] %}
|
||||
{# #}
|
||||
{%- endif -%}
|
||||
{#- Version specific key available? -#}
|
||||
{%- if php_version in apt_repositories_available[repo] and 'key' in apt_repositories_available[repo][php_version] %}
|
||||
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv {{ apt_repositories_available[repo][php_version]['key'] }} \
|
||||
{# Generic key available? #}
|
||||
{% elif 'all' in apt_repositories_available[repo] and 'key' in apt_repositories_available[repo]['all'] %}
|
||||
{# #}
|
||||
{#- Generic key available? -#}
|
||||
{%- elif 'all' in apt_repositories_available[repo] and 'key' in apt_repositories_available[repo]['all'] %}
|
||||
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv {{ apt_repositories_available[repo]['all']['key'] }} \
|
||||
{% endif %}
|
||||
{# Version specific repository available? #}
|
||||
{% if php_version in apt_repositories_available[repo] and 'deb' in apt_repositories_available[repo][php_version] %}
|
||||
{# #}
|
||||
{%- endif -%}
|
||||
{#- Version specific repository available? -#}
|
||||
{%- if php_version in apt_repositories_available[repo] and 'deb' in apt_repositories_available[repo][php_version] %}
|
||||
&& echo "{{ apt_repositories_available[repo][php_version]['deb'] }}" > /etc/apt/sources.list.d/{{ repo }}.list \
|
||||
{# Generic repository available? #}
|
||||
{% else %}
|
||||
{# #}
|
||||
{#- Generic repository available? -#}
|
||||
{%- else %}
|
||||
&& echo "{{ apt_repositories_available[repo]['all']['deb'] }}" > /etc/apt/sources.list.d/{{ repo }}.list \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
{# #}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
|
||||
ack-grep \
|
||||
aspell \
|
||||
autoconf \
|
||||
@@ -115,9 +122,11 @@ RUN set -x \
|
||||
whois \
|
||||
wkhtmltopdf \
|
||||
xz-utils \
|
||||
{% if php_version != 5.2 %}
|
||||
yarn \
|
||||
{% endif %}
|
||||
zsh \
|
||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
@@ -177,10 +186,20 @@ RUN \
|
||||
### Verify
|
||||
###
|
||||
RUN set -x \
|
||||
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^{{ php_version }}' \
|
||||
&& /usr/local/sbin/php-fpm --test \
|
||||
\
|
||||
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
|
||||
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
|
||||
\
|
||||
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
|
||||
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
|
||||
&& rm -f /usr/local/etc/php/php.ini
|
||||
|
||||
RUN set -x \
|
||||
{% for tool in software_enabled %}
|
||||
|
||||
@@ -740,26 +740,28 @@ extensions_enabled:
|
||||
###
|
||||
# all: is generic version of defines
|
||||
# 7.2: is specific version of defines
|
||||
# disabled: [optional] Array of PHP versions for which to disable this module
|
||||
# disabled: [optional] Array of PHP versions for which to disable this module
|
||||
# already_avail: [optional] Array of PHP versions for which we don't install the module, but
|
||||
# the dependencies, as it is already loaded by core
|
||||
#
|
||||
# all, 7.2, 7.1, 7.0, 5.6, 5.5, 5.4:
|
||||
# pre: [optional] Run command before anything else
|
||||
# build_dep: [optional] Array of build dependencies
|
||||
# run_dep: [optional] Array of run-time dependencies
|
||||
# type: [required] One of 'builtin', 'pecl' or 'git'
|
||||
# pre: [optional] Run command before anything else
|
||||
# build_dep: [optional] Array of build dependencies
|
||||
# run_dep: [optional] Array of run-time dependencies
|
||||
# type: [required] One of 'builtin', 'pecl' or 'git'
|
||||
#
|
||||
# type: builtin
|
||||
# configure: [optional] Add './configure' arguments
|
||||
# configure: [optional] Add './configure' arguments
|
||||
# type: pecl
|
||||
# version: [optional] Pecl packet version
|
||||
# command: [optional] Overwrite pecl command (pecl install ext)
|
||||
# version: [optional] Pecl packet version
|
||||
# command: [optional] Overwrite pecl command (pecl install ext)
|
||||
# type: git
|
||||
# git_url: [required] Git repository URL
|
||||
# git_ref: [optional] Tag, branch, commit to checkout
|
||||
# configure: [optional] Add './configure' arguments
|
||||
# command: [optional] Overwrite default command (phpize && ./configure && make && make install)
|
||||
# git_url: [required] Git repository URL
|
||||
# git_ref: [optional] Tag, branch, commit to checkout
|
||||
# configure: [optional] Add './configure' arguments
|
||||
# command: [optional] Overwrite default command (phpize && ./configure && make && make install)
|
||||
# type: custom
|
||||
# command: [required] Custom command to install and enable a module
|
||||
# command: [required] Custom command to install and enable a module
|
||||
extensions_available:
|
||||
amqp:
|
||||
disabled: [7.3]
|
||||
@@ -805,9 +807,11 @@ extensions_available:
|
||||
all:
|
||||
type: builtin
|
||||
ctype:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
curl:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
build_dep: [libcurl4-openssl-dev]
|
||||
@@ -815,6 +819,7 @@ extensions_available:
|
||||
all:
|
||||
type: builtin
|
||||
dom:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
configure: --with-libxml-dir=/usr
|
||||
@@ -831,14 +836,16 @@ extensions_available:
|
||||
all:
|
||||
type: builtin
|
||||
fileinfo:
|
||||
already_avail: [5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
5.2:
|
||||
type: pecl
|
||||
build_dep: [libmagic-dev]
|
||||
all:
|
||||
type: builtin
|
||||
filter:
|
||||
disabled: "{{ php_all_versions }}" # Available by default
|
||||
already_avail: "{{ php_all_versions }}" # Available by default
|
||||
ftp:
|
||||
already_avail: [5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
configure: --with-openssl-dir
|
||||
@@ -905,12 +912,17 @@ extensions_available:
|
||||
pre: ln /usr/include/x86_64-linux-gnu/gmp.h /usr/include/
|
||||
build_dep: [libgmp-dev]
|
||||
hash:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
iconv:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
igbinary:
|
||||
5.2:
|
||||
type: pecl
|
||||
version: 2.0.7
|
||||
all:
|
||||
type: pecl
|
||||
imagick:
|
||||
@@ -973,6 +985,7 @@ extensions_available:
|
||||
&& rm -rf ioncube \
|
||||
&& rm -rf ioncube.tar.gz \
|
||||
json:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
7.0:
|
||||
type: builtin
|
||||
build_dep: [bison]
|
||||
@@ -985,9 +998,9 @@ extensions_available:
|
||||
configure: --with-ldap --with-ldap-sasl
|
||||
build_dep: [libldap2-dev, libsasl2-dev]
|
||||
libxml:
|
||||
disabled: "{{ php_all_versions }}" # Available by default
|
||||
already_avail: "{{ php_all_versions }}" # Available by default
|
||||
mbstring:
|
||||
disabled: [7.3]
|
||||
already_avail: [5.2, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
mcrypt:
|
||||
@@ -1083,6 +1096,7 @@ extensions_available:
|
||||
all:
|
||||
type: pecl
|
||||
mysql:
|
||||
already_avail: [5.2, 5.3]
|
||||
disabled: [7.0, 7.1, 7.2, 7.3] # Deprecated in newer versions
|
||||
5.6:
|
||||
type: builtin
|
||||
@@ -1091,10 +1105,12 @@ extensions_available:
|
||||
type: builtin
|
||||
run_dep: [libmysqlclient18]
|
||||
mysqli:
|
||||
already_avail: [5.2]
|
||||
all:
|
||||
type: builtin
|
||||
mysqlnd:
|
||||
disabled: "{{ php_all_versions }}" # Available by default
|
||||
disabled: [5.2]
|
||||
already_avail: [5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
oci8:
|
||||
disabled: "{{ php_all_versions }}" # TODO: Oracle library is missing
|
||||
odbc:
|
||||
@@ -1112,15 +1128,16 @@ extensions_available:
|
||||
all:
|
||||
type: builtin
|
||||
openssl:
|
||||
disabled: "{{ php_all_versions }}" # Available by default
|
||||
already_avail: "{{ php_all_versions }}" # Available by default
|
||||
pcntl:
|
||||
all:
|
||||
type: builtin
|
||||
pcre:
|
||||
disabled: "{{ php_all_versions }}" # Available by default
|
||||
already_avail: "{{ php_all_versions }}" # Available by default
|
||||
pdo:
|
||||
# https://github.com/docker-library/php/issues/618
|
||||
disabled: [7.0] # TODO: Currently disabled due to bug in built
|
||||
#disabled: [7.0] # TODO: Currently disabled due to bug in built
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
pdo_dblib:
|
||||
@@ -1135,12 +1152,16 @@ extensions_available:
|
||||
build_dep: [libfbclient2, libib-util, firebird-dev]
|
||||
run_dep: [libfbclient2]
|
||||
pdo_mysql:
|
||||
already_avail: [5.2]
|
||||
all:
|
||||
type: builtin
|
||||
configure: --with-zlib-dir=/usr
|
||||
build_dep: [zlib1g-dev]
|
||||
pdo_oci:
|
||||
disabled: "{{ php_all_versions }}" # TODO: Oracle library is missing
|
||||
# disabled: [5.2]
|
||||
# all:
|
||||
# type: builtin
|
||||
pdo_odbc:
|
||||
disabled: "{{ php_all_versions }}" # TODO: Build errors
|
||||
pdo_pgsql:
|
||||
@@ -1149,6 +1170,7 @@ extensions_available:
|
||||
build_dep: [libpq-dev]
|
||||
run_dep: [libpq5]
|
||||
pdo_sqlite:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
build_dep: [libsqlite3-dev]
|
||||
@@ -1183,12 +1205,14 @@ extensions_available:
|
||||
phar:
|
||||
# https://github.com/docker-library/php/issues/618
|
||||
disabled: [5.6, 7.0] # TODO: Currently disabled due to bug in built
|
||||
already_avail: [5.3, 5.4, 5.5, 7.1, 7.2, 7.3]
|
||||
5.2:
|
||||
type: pecl
|
||||
all:
|
||||
type: builtin
|
||||
build_dep: [libssl-dev]
|
||||
posix:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
pspell:
|
||||
@@ -1197,11 +1221,13 @@ extensions_available:
|
||||
build_dep: [libpspell-dev]
|
||||
run_dep: [libaspell15]
|
||||
readline:
|
||||
disabled: [5.2, 5.3, 5.4] # Available by default
|
||||
disabled: [5.3]
|
||||
already_avail: [5.2, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
build_dep: [libedit-dev, libreadline-dev]
|
||||
recode:
|
||||
already_avail: [5.3, 5.4]
|
||||
all:
|
||||
type: builtin
|
||||
build_dep: [librecode-dev]
|
||||
@@ -1219,6 +1245,7 @@ extensions_available:
|
||||
build_dep: [librdkafka-dev]
|
||||
run_dep: [librdkafka1]
|
||||
session:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
configure: --with-mm
|
||||
@@ -1227,6 +1254,7 @@ extensions_available:
|
||||
all:
|
||||
type: builtin
|
||||
simplexml:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
configure: --with-libxml-dir=/usr
|
||||
@@ -1238,6 +1266,7 @@ extensions_available:
|
||||
build_dep: [libssl-dev, libsnmp-dev, snmp]
|
||||
run_dep: [snmp]
|
||||
soap:
|
||||
already_avail: [5.2]
|
||||
all:
|
||||
type: builtin
|
||||
configure: --with-libxml-dir=/usr
|
||||
@@ -1247,6 +1276,7 @@ extensions_available:
|
||||
type: builtin
|
||||
sodium:
|
||||
disabled: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1]
|
||||
already_avail: [7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
build_dep: [libsodium-dev]
|
||||
@@ -1342,6 +1372,7 @@ extensions_available:
|
||||
build_dep: [libtidy-dev]
|
||||
run_dep: [libtidy5]
|
||||
tokenizer:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
uploadprogress:
|
||||
@@ -1388,12 +1419,13 @@ extensions_available:
|
||||
all:
|
||||
type: pecl
|
||||
xml:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
configure: --with-libxml-dir=/usr
|
||||
build_dep: [libxml2-dev]
|
||||
xmlreader:
|
||||
disabled: [7.0, 7.1, 7.2, 7.3] # Available by default
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
configure: --with-libxml-dir=/usr
|
||||
@@ -1404,6 +1436,7 @@ extensions_available:
|
||||
configure: --with-libxml-dir=/usr --with-iconv-dir=/usr
|
||||
build_dep: [libxml2-dev]
|
||||
xmlwriter:
|
||||
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3]
|
||||
all:
|
||||
type: builtin
|
||||
configure: --with-libxml-dir=/usr
|
||||
|
||||
Reference in New Issue
Block a user