mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2025-12-10 11:01:14 +00:00
Split out tools
This commit is contained in:
402
.ansible/DOCKERFILES/Dockerfile-slim.j2
Normal file
402
.ansible/DOCKERFILES/Dockerfile-slim.j2
Normal file
@@ -0,0 +1,402 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
{{ edit_comment_slim }}
|
||||||
|
{% import './jinja2/macros-work.j2' as fn %}
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:{{ php_version }}-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
{%- for repo in base_apt_repositories_enabled -%}
|
||||||
|
{#- Not disabled -#}
|
||||||
|
{%- if ('disabled' not in base_apt_repositories_available[repo]) or (php_version not in base_apt_repositories_available[repo]['disabled']) -%}
|
||||||
|
{#- -#}
|
||||||
|
{#- [PRE] -#}
|
||||||
|
{%- if fn.get_pre(php_version, repo, base_apt_repositories_available) | length -%}
|
||||||
|
{{ "\n\t" }}&& {{ fn.get_pre(php_version, repo, base_apt_repositories_available) | indent( "\t" ) }}{{ "\t\\" }}
|
||||||
|
{%- endif -%}
|
||||||
|
{#- -#}
|
||||||
|
{#- [KEY] -#}
|
||||||
|
{%- if fn.tool_repo_get_key(php_version, repo, base_apt_repositories_available) | length -%}
|
||||||
|
{{ "\n\t" }}&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv {{ fn.tool_repo_get_key(php_version, repo, base_apt_repositories_available) }} \
|
||||||
|
{%- endif -%}
|
||||||
|
{#- -#}
|
||||||
|
{#- [DEB] -#}
|
||||||
|
{%- if fn.tool_repo_get_deb(php_version, repo, base_apt_repositories_available) | length -%}
|
||||||
|
{{ "\n\t" }}&& echo "{{ fn.tool_repo_get_deb(php_version, repo, base_apt_repositories_available) }}" > /etc/apt/sources.list.d/{{ repo }}.list \
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{{ "\n\t" }}&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
{% if php_version in [7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2] %}
|
||||||
|
mariadb-client \
|
||||||
|
{% else %}
|
||||||
|
mysql-client \
|
||||||
|
{% endif %}
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
{% for tool in base_software_enabled -%}
|
||||||
|
{# Not disabled #}
|
||||||
|
{%- if ('disabled' not in base_software_available[tool]) or (php_version not in base_software_available[tool]['disabled']) -%}
|
||||||
|
{{- "\n" }}# -------------------- {{ tool }} --------------------
|
||||||
|
{{- "\n" }}RUN set -eux \
|
||||||
|
{#- -#}
|
||||||
|
{#- [PRE] -#}
|
||||||
|
{%- if fn.get_pre(php_version, tool, base_software_available) | length -%}
|
||||||
|
{{ "\n\t" }}&& {{ fn.get_pre(php_version, tool, base_software_available) | indent( "\t" ) }}{{ "\t\\" }}
|
||||||
|
{%- endif -%}
|
||||||
|
{#- -#}
|
||||||
|
{#- [COMMAND] -#}
|
||||||
|
{%- if fn.get_type(php_version, tool, base_software_available) == 'custom' -%}
|
||||||
|
{{ "\n\t" }}&& {{ fn.tool_custom_get_command(php_version, tool, base_software_available) | indent( "\t" ) }}{{ "\t\\" }}
|
||||||
|
{%- endif -%}
|
||||||
|
{#- -#}
|
||||||
|
{#- [POST] -#}
|
||||||
|
{%- if fn.get_post(php_version, tool, base_software_available) | length -%}
|
||||||
|
{{ "\n\t" }}&& {{ fn.get_post(php_version, tool, base_software_available) | indent( "\t" ) }}{{ "\t\\" }}
|
||||||
|
{%- endif -%}
|
||||||
|
{#- -#}
|
||||||
|
{#- [CHECK] -#}
|
||||||
|
{%- if 'check' in base_software_available[tool] -%}
|
||||||
|
{{ "\n\t" }}&& {{ base_software_available[tool]['check'] | indent( "\t" ) }}{{ "\t\\" }}
|
||||||
|
{%- endif -%}
|
||||||
|
{#- -#}
|
||||||
|
{#- Finalize -#}
|
||||||
|
{{ "\n\t" }}&& true{{ "\n" }}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:{{ php_version }}-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-{{ php_version }}.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-{{ php_version }}.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
{% for tool in base_software_enabled -%}
|
||||||
|
{# Not disabled #}
|
||||||
|
{%- if ('disabled' not in base_software_available[tool]) or (php_version not in base_software_available[tool]['disabled']) -%}
|
||||||
|
{{- "\n" }}# -------------------- {{ tool }} --------------------
|
||||||
|
{{- "\n" }}RUN set -eux \
|
||||||
|
{#- -#}
|
||||||
|
{#- [CHECK] -#}
|
||||||
|
{%- if 'check' in base_software_available[tool] -%}
|
||||||
|
{{ "\n\t" }}&& {{ base_software_available[tool]['check'] | indent( "\t" ) }}{{ "\t\\" }}
|
||||||
|
{%- endif -%}
|
||||||
|
{#- -#}
|
||||||
|
{#- Finalize -#}
|
||||||
|
{{ "\n\t" }}&& true{{ "\n" }}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor %}
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& 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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="{{ php_version }}-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM {{ php_version }}-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM {{ php_version }}-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@
|
|||||||
edit_comment_base: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead."
|
edit_comment_base: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead."
|
||||||
edit_comment_mods: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-mods.j2 instead."
|
edit_comment_mods: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-mods.j2 instead."
|
||||||
edit_comment_prod: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead."
|
edit_comment_prod: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead."
|
||||||
|
edit_comment_slim: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead."
|
||||||
edit_comment_work: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-work.j2 instead."
|
edit_comment_work: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-work.j2 instead."
|
||||||
|
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ php_all_versions:
|
|||||||
|
|
||||||
|
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
# Docker file paths for each version for base, mods, prod & work
|
# Docker file paths for each version for base, mods, prod, slim & work
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
template_dockerfiles:
|
template_dockerfiles:
|
||||||
- src: DOCKERFILES/Dockerfile-base.j2
|
- src: DOCKERFILES/Dockerfile-base.j2
|
||||||
@@ -47,6 +48,8 @@ template_dockerfiles:
|
|||||||
dst: "../Dockerfiles/mods/Dockerfile-{{ php_version }}"
|
dst: "../Dockerfiles/mods/Dockerfile-{{ php_version }}"
|
||||||
- src: DOCKERFILES/Dockerfile-prod.j2
|
- src: DOCKERFILES/Dockerfile-prod.j2
|
||||||
dst: "../Dockerfiles/prod/Dockerfile-{{ php_version }}"
|
dst: "../Dockerfiles/prod/Dockerfile-{{ php_version }}"
|
||||||
|
- src: DOCKERFILES/Dockerfile-slim.j2
|
||||||
|
dst: "../Dockerfiles/slim/Dockerfile-{{ php_version }}"
|
||||||
- src: DOCKERFILES/Dockerfile-work.j2
|
- src: DOCKERFILES/Dockerfile-work.j2
|
||||||
dst: "../Dockerfiles/work/Dockerfile-{{ php_version }}"
|
dst: "../Dockerfiles/work/Dockerfile-{{ php_version }}"
|
||||||
|
|
||||||
@@ -55,6 +58,7 @@ template_dockerfiles:
|
|||||||
# Assign php.ini & php-fpm.conf to PHP versions
|
# Assign php.ini & php-fpm.conf to PHP versions
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
template_configurations:
|
template_configurations:
|
||||||
|
|
||||||
# php.ini
|
# php.ini
|
||||||
- src: CONFIGURATIONS/php.ini.j2
|
- src: CONFIGURATIONS/php.ini.j2
|
||||||
dst: "../Dockerfiles/base/data/php-ini.d/php-{{ php_version }}.ini"
|
dst: "../Dockerfiles/base/data/php-ini.d/php-{{ php_version }}.ini"
|
||||||
@@ -62,10 +66,11 @@ template_configurations:
|
|||||||
key: base
|
key: base
|
||||||
alt: base
|
alt: base
|
||||||
- src: CONFIGURATIONS/php.ini.j2
|
- src: CONFIGURATIONS/php.ini.j2
|
||||||
dst: "../Dockerfiles/work/data/php-ini.d/php-{{ php_version }}.ini"
|
dst: "../Dockerfiles/slim/data/php-ini.d/php-{{ php_version }}.ini"
|
||||||
cfg: "{{ php_settings_ini }}"
|
cfg: "{{ php_settings_ini }}"
|
||||||
key: work
|
key: slim
|
||||||
alt: base # Alternative key to use when definition is not set in 'work'
|
alt: base # Alternative key to use when definition is not set in 'slim'
|
||||||
|
|
||||||
# php-fpm.conf
|
# php-fpm.conf
|
||||||
- src: CONFIGURATIONS/php-fpm.conf.j2
|
- src: CONFIGURATIONS/php-fpm.conf.j2
|
||||||
dst: "../Dockerfiles/base/data/php-fpm.conf/php-fpm-{{ php_version }}.conf"
|
dst: "../Dockerfiles/base/data/php-fpm.conf/php-fpm-{{ php_version }}.conf"
|
||||||
@@ -73,7 +78,7 @@ template_configurations:
|
|||||||
key: base
|
key: base
|
||||||
alt: base
|
alt: base
|
||||||
- src: CONFIGURATIONS/php-fpm.conf.j2
|
- src: CONFIGURATIONS/php-fpm.conf.j2
|
||||||
dst: "../Dockerfiles/work/data/php-fpm.conf/php-fpm-{{ php_version }}.conf"
|
dst: "../Dockerfiles/slim/data/php-fpm.conf/php-fpm-{{ php_version }}.conf"
|
||||||
cfg: "{{ php_settings_fpm }}"
|
cfg: "{{ php_settings_fpm }}"
|
||||||
key: work
|
key: slim
|
||||||
alt: base
|
alt: base # Alternative key to use when definition is not set in 'slim'
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ php_settings_ini:
|
|||||||
# ---- Inherits from base ----
|
# ---- Inherits from base ----
|
||||||
prod:
|
prod:
|
||||||
# ---- Inherits from base and overwrites certain values ----
|
# ---- Inherits from base and overwrites certain values ----
|
||||||
work:
|
slim:
|
||||||
# Error reporting
|
# Error reporting
|
||||||
error_reporting: E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED
|
error_reporting: E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED
|
||||||
xmlrpc_errors: 'Off'
|
xmlrpc_errors: 'Off'
|
||||||
@@ -73,6 +73,8 @@ php_settings_ini:
|
|||||||
xdebug3_mode: 'Off'
|
xdebug3_mode: 'Off'
|
||||||
xdebug3_start_with_request: 'default'
|
xdebug3_start_with_request: 'default'
|
||||||
xdebug3_client_port: '9000'
|
xdebug3_client_port: '9000'
|
||||||
|
# ---- Inherits from slim ----
|
||||||
|
work:
|
||||||
|
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
# php-fpm.conf
|
# php-fpm.conf
|
||||||
@@ -109,5 +111,7 @@ php_settings_fpm:
|
|||||||
mods:
|
mods:
|
||||||
# ---- Inherits from base ----
|
# ---- Inherits from base ----
|
||||||
prod:
|
prod:
|
||||||
# ---- Inherits from base and overwrites certain values ----
|
# ---- Inherits from base ----
|
||||||
|
slim:
|
||||||
|
# ---- Inherits from base ----
|
||||||
work:
|
work:
|
||||||
|
|||||||
522
.ansible/group_vars/all/slim.yml
Normal file
522
.ansible/group_vars/all/slim.yml
Normal file
@@ -0,0 +1,522 @@
|
|||||||
|
---
|
||||||
|
###################################################################################################
|
||||||
|
# Docker: slim
|
||||||
|
###################################################################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# This file holds definition for all devibox/php-fpm:x.y-slim images
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Define operating system versions
|
||||||
|
###
|
||||||
|
os_release:
|
||||||
|
# Bullseye (Ubuntu: focal, groovy, hirsute, impish)
|
||||||
|
all:
|
||||||
|
debian: bullseye
|
||||||
|
ubuntu: focal
|
||||||
|
8.2:
|
||||||
|
debian: bullseye
|
||||||
|
ubuntu: focal
|
||||||
|
8.1:
|
||||||
|
debian: bullseye
|
||||||
|
ubuntu: focal
|
||||||
|
8.0:
|
||||||
|
debian: bullseye
|
||||||
|
ubuntu: focal
|
||||||
|
7.4:
|
||||||
|
debian: bullseye
|
||||||
|
ubuntu: focal
|
||||||
|
7.3:
|
||||||
|
debian: bullseye
|
||||||
|
ubuntu: focal
|
||||||
|
# Buster (Ubuntu: bionic, cosmic, disco, eoan)
|
||||||
|
7.2:
|
||||||
|
debian: buster
|
||||||
|
ubuntu: bionic
|
||||||
|
7.1:
|
||||||
|
debian: buster
|
||||||
|
ubuntu: bionic
|
||||||
|
# Strech (Ubuntu: xenial, yakkety, zesty, artful)
|
||||||
|
7.0:
|
||||||
|
debian: stretch
|
||||||
|
ubuntu: xenial
|
||||||
|
5.6:
|
||||||
|
debian: stretch
|
||||||
|
ubuntu: xenial
|
||||||
|
# Jessie (Ubuntu: trusty, utopic, vivid, wily)
|
||||||
|
5.5:
|
||||||
|
debian: jessie
|
||||||
|
ubuntu: trusty
|
||||||
|
5.4:
|
||||||
|
debian: jessie
|
||||||
|
ubuntu: trusty
|
||||||
|
5.3:
|
||||||
|
debian: jessie
|
||||||
|
ubuntu: trusty
|
||||||
|
5.2:
|
||||||
|
debian: jessie
|
||||||
|
ubuntu: trusty
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Apt repositories to enable (in defined order)
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
base_apt_repositories_enabled:
|
||||||
|
- backports
|
||||||
|
- blackfire
|
||||||
|
- mongo
|
||||||
|
- pgsql
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Software to install (in defined order)
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
base_software_enabled:
|
||||||
|
- blackfire
|
||||||
|
- mhsendmail
|
||||||
|
- mongo_client
|
||||||
|
- mysqldumpsecure
|
||||||
|
- pgsql_client
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Apt repository definition
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
# all, 7.2, 7.1, 7.0, 5.6, 5.5, 5.4:
|
||||||
|
# deb: Deb line to add to sources list
|
||||||
|
# key: [optional] Key id to add for repository
|
||||||
|
# pre: [optional] Run custom command to add gpg key for repository
|
||||||
|
#
|
||||||
|
base_apt_repositories_available:
|
||||||
|
|
||||||
|
###
|
||||||
|
### Backports
|
||||||
|
###
|
||||||
|
backports:
|
||||||
|
# [Bullseye]
|
||||||
|
all:
|
||||||
|
type: repo
|
||||||
|
pre: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
|
||||||
|
deb: deb http://ftp.debian.org/debian {{ os_release['all'].debian }}-backports main
|
||||||
|
# [Buster]
|
||||||
|
7.2:
|
||||||
|
type: repo
|
||||||
|
pre: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
|
||||||
|
deb: deb http://ftp.debian.org/debian {{ os_release[7.2].debian }}-backports main
|
||||||
|
# [Buster]
|
||||||
|
7.1:
|
||||||
|
type: repo
|
||||||
|
pre: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
|
||||||
|
deb: deb http://ftp.debian.org/debian {{ os_release[7.1].debian }}-backports main
|
||||||
|
# [Stretch]
|
||||||
|
7.0:
|
||||||
|
type: repo
|
||||||
|
pre: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
|
||||||
|
deb: deb http://ftp.debian.org/debian {{ os_release[7.0].debian }}-backports main
|
||||||
|
# [Stretch]
|
||||||
|
5.6:
|
||||||
|
type: repo
|
||||||
|
pre: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
|
||||||
|
deb: deb http://ftp.debian.org/debian {{ os_release[5.6].debian }}-backports main
|
||||||
|
# [Jessie]
|
||||||
|
5.5:
|
||||||
|
type: repo
|
||||||
|
pre: echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until
|
||||||
|
deb: deb [trusted=yes] http://archive.debian.org/debian {{ os_release[5.5].debian }}-backports main
|
||||||
|
# [Jessie]
|
||||||
|
5.4:
|
||||||
|
type: repo
|
||||||
|
pre: echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until
|
||||||
|
deb: deb [trusted=yes] http://archive.debian.org/debian {{ os_release[5.4].debian }}-backports main
|
||||||
|
# [Jessie]
|
||||||
|
5.3:
|
||||||
|
type: repo
|
||||||
|
pre: echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until
|
||||||
|
deb: deb [trusted=yes] http://archive.debian.org/debian {{ os_release[5.3].debian }}-backports main
|
||||||
|
# [Jessie]
|
||||||
|
5.2:
|
||||||
|
type: repo
|
||||||
|
pre: echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until
|
||||||
|
deb: deb [trusted=yes] http://archive.debian.org/debian {{ os_release[5.2].debian }}-backports main
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
blackfire:
|
||||||
|
all:
|
||||||
|
type: repo
|
||||||
|
deb: deb http://packages.blackfire.io/debian any main
|
||||||
|
pre: curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -
|
||||||
|
|
||||||
|
###
|
||||||
|
### MongoDB (currently obsolete)
|
||||||
|
###
|
||||||
|
mongo:
|
||||||
|
# 8.2: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 8.1: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 8.0: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 7.4: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 7.3: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 7.2: mongo-tools OR mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 7.1: mongo-tools OR mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 7.0: mongodb-clients & mongo-tools (amd64, arm64)
|
||||||
|
# 5.6: mongodb-clients & mongo-tools (amd64, arm64)
|
||||||
|
# 5.5: mongodb-clients (amd64)
|
||||||
|
# 5.4: mongodb-clients (amd64)
|
||||||
|
# 5.3: mongodb-clients (amd64)
|
||||||
|
# 5.2: mongodb-clients (amd64)
|
||||||
|
disabled: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0] # TODO: Why were those disabled?
|
||||||
|
# [Bullseye] Ubuntu repository required for arm64 support instead
|
||||||
|
all:
|
||||||
|
type: repo
|
||||||
|
# gpg --dry-run --with-fingerprint < <(curl https://www.mongodb.org/static/pgp/server-4.4.asc) | grep fingerprint | sed 's/.*=//g' | sed 's/ //g'
|
||||||
|
deb: deb http://repo.mongodb.org/apt/ubuntu {{ os_release['all'].ubuntu }}/mongodb-org/4.4 multiverse
|
||||||
|
key: 20691EEC35216C63CAF66CE1656408E390CFB1F5
|
||||||
|
# [Buster] Ubuntu repository required for arm64 support instead
|
||||||
|
7.2:
|
||||||
|
type: repo
|
||||||
|
# gpg --dry-run --with-fingerprint < <(curl https://www.mongodb.org/static/pgp/server-4.4.asc) | grep fingerprint | sed 's/.*=//g' | sed 's/ //g'
|
||||||
|
deb: deb http://repo.mongodb.org/apt/ubuntu {{ os_release[7.2].ubuntu }}/mongodb-org/4.4 multiverse
|
||||||
|
key: 20691EEC35216C63CAF66CE1656408E390CFB1F5
|
||||||
|
# [Buster] Ubuntu repository required for arm64 support instead
|
||||||
|
7.1:
|
||||||
|
type: repo
|
||||||
|
# gpg --dry-run --with-fingerprint < <(curl https://www.mongodb.org/static/pgp/server-4.4.asc) | grep fingerprint | sed 's/.*=//g' | sed 's/ //g'
|
||||||
|
deb: deb http://repo.mongodb.org/apt/ubuntu {{ os_release[7.1].ubuntu }}/mongodb-org/4.4 multiverse
|
||||||
|
key: 20691EEC35216C63CAF66CE1656408E390CFB1F5
|
||||||
|
|
||||||
|
###
|
||||||
|
### PostgrSQL (currently obsolete)
|
||||||
|
###
|
||||||
|
pgsql:
|
||||||
|
# [Bullseye]
|
||||||
|
all:
|
||||||
|
type: repo
|
||||||
|
deb: deb http://apt.postgresql.org/pub/repos/apt/ {{ os_release['all'].debian }}-pgdg main
|
||||||
|
pre: curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -
|
||||||
|
# [Buster]
|
||||||
|
7.2:
|
||||||
|
type: repo
|
||||||
|
deb: deb http://apt.postgresql.org/pub/repos/apt/ {{ os_release[7.2].debian }}-pgdg main
|
||||||
|
pre: curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -
|
||||||
|
# [Buster]
|
||||||
|
7.1:
|
||||||
|
type: repo
|
||||||
|
deb: deb http://apt.postgresql.org/pub/repos/apt/ {{ os_release[7.1].debian }}-pgdg main
|
||||||
|
pre: curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -
|
||||||
|
# [Stretch]
|
||||||
|
7.0:
|
||||||
|
type: repo
|
||||||
|
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[7.0].debian }}-pgdg main
|
||||||
|
# [Stretch]
|
||||||
|
5.6:
|
||||||
|
type: repo
|
||||||
|
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[5.6].debian }}-pgdg main
|
||||||
|
# [Jessie]
|
||||||
|
5.5:
|
||||||
|
type: repo
|
||||||
|
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[5.5].debian }}-pgdg main
|
||||||
|
# [Jessie]
|
||||||
|
5.4:
|
||||||
|
type: repo
|
||||||
|
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[5.4].debian }}-pgdg main
|
||||||
|
# [Jessie]
|
||||||
|
5.3:
|
||||||
|
type: repo
|
||||||
|
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[5.3].debian }}-pgdg main
|
||||||
|
# [Jessie]
|
||||||
|
5.2:
|
||||||
|
type: repo
|
||||||
|
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[5.2].debian }}-pgdg main
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Essential Software definition
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# check: [optional] Include a check command to test if it was installed successfully
|
||||||
|
#
|
||||||
|
# all, 7.2, 7.1, 7.0, 5.6, 5.5, 5.4:
|
||||||
|
# pre: [optional] Run command before 'command:' statement
|
||||||
|
# command: Command to execute
|
||||||
|
# post: [optional] Run command after 'command:' statement
|
||||||
|
#
|
||||||
|
base_software_available:
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
blackfire:
|
||||||
|
check: |
|
||||||
|
blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
all:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
apt-get update \
|
||||||
|
command: |
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
post: rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
###
|
||||||
|
### mhsendmail
|
||||||
|
###
|
||||||
|
mhsendmail:
|
||||||
|
all:
|
||||||
|
type: custom
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
|
||||||
|
###
|
||||||
|
### MongoDB Command line client
|
||||||
|
###
|
||||||
|
# 8.2: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 8.1: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 8.0: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 7.4: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 7.3: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 7.2: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 7.1: mongodb-org-(tools|shell) (amd64, arm64)
|
||||||
|
# 7.0: mongodb-clients & mongo-tools (amd64, arm64)
|
||||||
|
# 5.6: mongodb-clients & mongo-tools (amd64, arm64)
|
||||||
|
# 5.5: mongodb-clients (amd64)
|
||||||
|
# 5.4: mongodb-clients (amd64)
|
||||||
|
# 5.3: mongodb-clients (amd64)
|
||||||
|
# 5.2: mongodb-clients (amd64)
|
||||||
|
mongo_client:
|
||||||
|
check: |
|
||||||
|
if echo '{{ php_version }}' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
all:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu {{ os_release[php_version].ubuntu }}/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& apt-get update \
|
||||||
|
command: |
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-org-tools \
|
||||||
|
mongodb-org-shell \
|
||||||
|
post: rm -rf /var/lib/apt/lists/*
|
||||||
|
7.0:
|
||||||
|
type: custom
|
||||||
|
pre: apt-get update
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients \
|
||||||
|
mongo-tools; \
|
||||||
|
else \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
5.6:
|
||||||
|
type: custom
|
||||||
|
pre: apt-get update
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients \
|
||||||
|
mongo-tools; \
|
||||||
|
else \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
5.5:
|
||||||
|
type: custom
|
||||||
|
pre: apt-get update
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
5.4:
|
||||||
|
type: custom
|
||||||
|
pre: apt-get update
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
5.3:
|
||||||
|
type: custom
|
||||||
|
pre: apt-get update
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
5.2:
|
||||||
|
type: custom
|
||||||
|
pre: apt-get update
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
|
||||||
|
###
|
||||||
|
### mysqldump-secure
|
||||||
|
###
|
||||||
|
mysqldumpsecure:
|
||||||
|
check: mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+'
|
||||||
|
all:
|
||||||
|
type: custom
|
||||||
|
command: |
|
||||||
|
git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
|
||||||
|
###
|
||||||
|
### PostgrSQL Command line client
|
||||||
|
###
|
||||||
|
# 8.2: (amd64, arm64)
|
||||||
|
# 8.1: (amd64, arm64)
|
||||||
|
# 8.0: (amd64, arm64)
|
||||||
|
# 7.4: (amd64, arm64)
|
||||||
|
# 7.3: (amd64, arm64)
|
||||||
|
# 7.2: (amd64, arm64)
|
||||||
|
# 7.1: (amd64, arm64)
|
||||||
|
# 7.0: (amd64)
|
||||||
|
# 5.6: (amd64)
|
||||||
|
# 5.5: (amd64)
|
||||||
|
# 5.4: (amd64)
|
||||||
|
# 5.3: (amd64)
|
||||||
|
# 5.2: (amd64)
|
||||||
|
pgsql_client:
|
||||||
|
check: |
|
||||||
|
if echo '{{ php_version }}' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
all:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update \
|
||||||
|
command: |
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client \
|
||||||
|
post: rm -rf /var/lib/apt/lists/*
|
||||||
|
7.0:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
|
5.6:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
|
5.5:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
|
5.4:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
|
5.3:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
|
5.2:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
command: |
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
262
.ansible/group_vars/all/work-help.yml
Normal file
262
.ansible/group_vars/all/work-help.yml
Normal file
@@ -0,0 +1,262 @@
|
|||||||
|
---
|
||||||
|
###################################################################################################
|
||||||
|
# Docker: work (docker stage: help)
|
||||||
|
###################################################################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# This file holds definition for all devibox/php-fpm:x.y-work images
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Global variables
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
composer_home: /usr/local/src/composer
|
||||||
|
nvm_home: /opt/nvm
|
||||||
|
node_version: --lts
|
||||||
|
|
||||||
|
directory_to_clean:
|
||||||
|
- .*json
|
||||||
|
- .ansible
|
||||||
|
- .cache
|
||||||
|
- .composer
|
||||||
|
- .config
|
||||||
|
- .console
|
||||||
|
- .drush
|
||||||
|
- .gem
|
||||||
|
- .local
|
||||||
|
- .node
|
||||||
|
- .npm
|
||||||
|
- .pm2
|
||||||
|
- .subversion
|
||||||
|
- .v8*
|
||||||
|
- node_modules
|
||||||
|
- yarn.lock
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Software to install (in defined order)
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
help_software_enabled:
|
||||||
|
- composer
|
||||||
|
- nvm
|
||||||
|
- pip
|
||||||
|
|
||||||
|
|
||||||
|
## -------------------------------------------------------------------------------------------------
|
||||||
|
## Software definition
|
||||||
|
## -------------------------------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# check: [optional] Include a check command to test if it was installed successfully
|
||||||
|
#
|
||||||
|
# all, 7.2, 7.1, 7.0, 5.6, 5.5, 5.4:
|
||||||
|
# pre: [optional] Run command before 'command:' statement
|
||||||
|
# command: Command to execute
|
||||||
|
# post: [optional] Run command after 'command:' statement
|
||||||
|
#
|
||||||
|
help_software_available:
|
||||||
|
|
||||||
|
###
|
||||||
|
### Composer
|
||||||
|
###
|
||||||
|
composer:
|
||||||
|
disabled: [5.2]
|
||||||
|
check: composer --version 2>/dev/null | grep -Ei '(composer|version)\s*[0-9][.0-9]+'
|
||||||
|
all:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
COMPOSER_1_VERSION="latest-1.x" \
|
||||||
|
&& COMPOSER_2_VERSION="latest-2.x" \
|
||||||
|
command: |
|
||||||
|
curl -sS -L --fail "https://getcomposer.org/download/${COMPOSER_1_VERSION}/composer.phar" > /usr/local/bin/composer-1 \
|
||||||
|
&& curl -sS -L --fail "https://getcomposer.org/download/${COMPOSER_2_VERSION}/composer.phar" > /usr/local/bin/composer-2 \
|
||||||
|
&& chmod +x /usr/local/bin/composer-1 \
|
||||||
|
&& chmod +x /usr/local/bin/composer-2 \
|
||||||
|
post: |
|
||||||
|
ln -sf /usr/local/bin/composer-2 /usr/local/bin/composer \
|
||||||
|
7.1:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
COMPOSER_1_VERSION="latest-1.x" \
|
||||||
|
&& COMPOSER_2_VERSION="latest-2.2.x" \
|
||||||
|
7.0:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
COMPOSER_1_VERSION="latest-1.x" \
|
||||||
|
&& COMPOSER_2_VERSION="latest-2.2.x" \
|
||||||
|
5.6:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
COMPOSER_1_VERSION="latest-1.x" \
|
||||||
|
&& COMPOSER_2_VERSION="latest-2.2.x" \
|
||||||
|
5.5:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
COMPOSER_1_VERSION="latest-1.x" \
|
||||||
|
&& COMPOSER_2_VERSION="latest-2.2.x" \
|
||||||
|
5.4:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
COMPOSER_1_VERSION="latest-1.x" \
|
||||||
|
&& COMPOSER_2_VERSION="latest-2.2.x" \
|
||||||
|
5.3:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
COMPOSER_1_VERSION="latest-1.x" \
|
||||||
|
&& COMPOSER_2_VERSION="latest-2.2.x" \
|
||||||
|
post: |
|
||||||
|
ln -sf /usr/local/bin/composer-1 /usr/local/bin/composer \
|
||||||
|
|
||||||
|
###
|
||||||
|
### nvm
|
||||||
|
###
|
||||||
|
nvm:
|
||||||
|
check: |
|
||||||
|
su -c '. {{ nvm_home }}/nvm.sh; nvm --version' devilbox | grep -E '^v?[0-9][.0-9]+' \
|
||||||
|
&& su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox | grep -E '^v?[0-9][.0-9]+' \
|
||||||
|
&& su -c '. {{ nvm_home }}/nvm.sh; yarn --version' devilbox | grep -E '^v?[0-9][.0-9]+' \
|
||||||
|
all:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
NODE_VERSION="{{ node_version }}" \
|
||||||
|
command: |
|
||||||
|
NVM_VERSION="$( \
|
||||||
|
curl -sS 'https://github.com/nvm-sh/nvm/releases' \
|
||||||
|
| grep -Eo '/nvm-sh/nvm/releases/tag/v?[.0-9]+"' \
|
||||||
|
| grep -Eo 'v?[.0-9]+' \
|
||||||
|
| sort -V \
|
||||||
|
| tail -1 \
|
||||||
|
)" \
|
||||||
|
&& mkdir -p {{ nvm_home }} \
|
||||||
|
&& curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh" \
|
||||||
|
| NVM_DIR="{{ nvm_home }}" bash \
|
||||||
|
\
|
||||||
|
&& { \
|
||||||
|
echo 'export NVM_DIR="{{ nvm_home }}"'; \
|
||||||
|
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm'; \
|
||||||
|
echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion'; \
|
||||||
|
} >> /home/devilbox/.bashrc \
|
||||||
|
\
|
||||||
|
&& chown -R devilbox:devilbox "{{ nvm_home }}" \
|
||||||
|
# Install latest and LTS version and yarn
|
||||||
|
post: |
|
||||||
|
su -c ". {{ nvm_home }}/nvm.sh; nvm install ${NODE_VERSION}" devilbox \
|
||||||
|
&& su -c ". {{ nvm_home }}/nvm.sh; nvm use ${NODE_VERSION}" devilbox \
|
||||||
|
&& su -c ". {{ nvm_home }}/nvm.sh; corepack enable" devilbox \
|
||||||
|
\
|
||||||
|
&& ln -s "{{ nvm_home }}/versions/node/$(su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox)/bin/corepack" /usr/local/bin/ \
|
||||||
|
&& ln -s "{{ nvm_home }}/versions/node/$(su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox)/bin/node" /usr/local/bin/ \
|
||||||
|
&& ln -s "{{ nvm_home }}/versions/node/$(su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox)/bin/npm" /usr/local/bin/ \
|
||||||
|
&& ln -s "{{ nvm_home }}/versions/node/$(su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox)/bin/npx" /usr/local/bin/ \
|
||||||
|
&& ln -s "{{ nvm_home }}/versions/node/$(su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox)/bin/yarn" /usr/local/bin/ \
|
||||||
|
\
|
||||||
|
&& chmod 0777 {{ nvm_home }} \
|
||||||
|
&& find {{ nvm_home }} -type f -print0 | xargs -n1 -0 chmod go+w \
|
||||||
|
&& find {{ nvm_home }} -type d -print0 | xargs -n1 -0 chmod 0777 \
|
||||||
|
\
|
||||||
|
&& rm -rf {{ nvm_home }}/.cache \
|
||||||
|
&& rm -rf {{ nvm_home }}/versions/node/$(su -c '. /opt/nvm/nvm.sh; node --version' devilbox)/share \
|
||||||
|
&& rm -rf {{ nvm_home }}/versions/node/$(su -c '. /opt/nvm/nvm.sh; node --version' devilbox)/include \
|
||||||
|
7.0:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
NODE_VERSION="17" \
|
||||||
|
5.6:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
NODE_VERSION="17" \
|
||||||
|
5.5:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
NODE_VERSION="17" \
|
||||||
|
5.4:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
NODE_VERSION="17" \
|
||||||
|
5.3:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
NODE_VERSION="17" \
|
||||||
|
5.2:
|
||||||
|
type: custom
|
||||||
|
pre: |
|
||||||
|
NODE_VERSION="17" \
|
||||||
|
|
||||||
|
###
|
||||||
|
### Python pip
|
||||||
|
###
|
||||||
|
pip:
|
||||||
|
check: pip --version
|
||||||
|
all:
|
||||||
|
type: custom
|
||||||
|
command: |
|
||||||
|
curl -sS -L --fail https://bootstrap.pypa.io/get-pip.py | python3 \
|
||||||
|
# Cleanup
|
||||||
|
post: |
|
||||||
|
/bin/ls -1 /usr/local/lib/ | grep ^python | while read -r version; do \
|
||||||
|
cd "/usr/local/lib/${version}/" \
|
||||||
|
&& find . -name '*.pyc' -print0 | xargs -0 -n1 rm -rf \
|
||||||
|
&& find . -name '*.exe' -print0 | xargs -0 -n1 rm -rf \
|
||||||
|
&& find . -name '__pycache__' -print0 | xargs -0 -n1 rm -rf \
|
||||||
|
\
|
||||||
|
&& if [ -d "dist-packages" ]; then \
|
||||||
|
cd "dist-packages" \
|
||||||
|
&& pwd \
|
||||||
|
&& if /bin/ls -1 | grep -v '^pip'; then \
|
||||||
|
/bin/ls -1 | grep -v '^pip' | xargs -n1 rm -rf; \
|
||||||
|
fi \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
run_dep: [python3-distutils]
|
||||||
|
build_dep: [libpython3-dev]
|
||||||
|
7.2:
|
||||||
|
type: custom
|
||||||
|
command: |
|
||||||
|
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
|
||||||
|
run_dep: []
|
||||||
|
build_dep: [libpython-dev]
|
||||||
|
7.1:
|
||||||
|
type: custom
|
||||||
|
command: |
|
||||||
|
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
|
||||||
|
run_dep: []
|
||||||
|
build_dep: [libpython-dev]
|
||||||
|
7.0:
|
||||||
|
type: custom
|
||||||
|
command: |
|
||||||
|
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
|
||||||
|
run_dep: []
|
||||||
|
build_dep: [libpython-dev]
|
||||||
|
5.6:
|
||||||
|
type: custom
|
||||||
|
command: |
|
||||||
|
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
|
||||||
|
run_dep: []
|
||||||
|
build_dep: [libpython-dev]
|
||||||
|
5.5:
|
||||||
|
type: custom
|
||||||
|
command: |
|
||||||
|
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
|
||||||
|
run_dep: []
|
||||||
|
build_dep: [libpython-dev]
|
||||||
|
5.4:
|
||||||
|
type: custom
|
||||||
|
command: |
|
||||||
|
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
|
||||||
|
run_dep: []
|
||||||
|
build_dep: [libpython-dev]
|
||||||
|
5.3:
|
||||||
|
type: custom
|
||||||
|
run_dep: []
|
||||||
|
build_dep: [libpython-dev]
|
||||||
|
command: |
|
||||||
|
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
|
||||||
|
5.2:
|
||||||
|
type: custom
|
||||||
|
command: |
|
||||||
|
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
|
||||||
|
run_dep: []
|
||||||
|
build_dep: [libpython-dev]
|
||||||
File diff suppressed because it is too large
Load Diff
273
.ansible/jinja2/macros-work.j2
Normal file
273
.ansible/jinja2/macros-work.j2
Normal file
@@ -0,0 +1,273 @@
|
|||||||
|
{##################################################################################################
|
||||||
|
# IMPORTS
|
||||||
|
##################################################################################################}
|
||||||
|
{% import './jinja2/macros.j2' as fn %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{##################################################################################################
|
||||||
|
# GENERIC MACROS
|
||||||
|
##################################################################################################}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Check if not disabled
|
||||||
|
###
|
||||||
|
### Returns 'true' string if not disabled, otherwise returns nothing
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro is_not_disabled(php, name, items) -%}
|
||||||
|
{%- if ('disabled' not in items[name]) or (php not in items[name]['disabled']) -%}
|
||||||
|
{{- 'true' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'type'
|
||||||
|
###
|
||||||
|
### Returns type string
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro get_type(php, name, items) -%}
|
||||||
|
{{- fn.get_val(php, name, items, 'type', '<WRONG TYPE>') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'pre'
|
||||||
|
###
|
||||||
|
### Returns pre string
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro get_pre(php, name, items) -%}
|
||||||
|
{{- fn.get_val(php, name, items, 'pre', '') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'post'
|
||||||
|
###
|
||||||
|
### Returns post string
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro get_post(php, name, items) -%}
|
||||||
|
{{- fn.get_val(php, name, items, 'post', '') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'build_dep'
|
||||||
|
###
|
||||||
|
### Returns json string (jsonified list) of build_dep (use '| to_json' to eval)
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro get_build_dep(php, name, items) -%}
|
||||||
|
{{- fn.get_list_if_enabled(php, name, items, 'build_dep') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'run_dep'
|
||||||
|
###
|
||||||
|
### Returns json string (jsonified list) of run_dep (use '| to_json' to eval)
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro get_run_dep(php, name, items) -%}
|
||||||
|
{{- fn.get_list_if_enabled(php, name, items, 'run_dep') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{##################################################################################################
|
||||||
|
# TOOLS SPECIFIC MACROS
|
||||||
|
##################################################################################################}
|
||||||
|
|
||||||
|
{# --------------------------------------------- REPO ----------------------------------------- -#}
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'deb'
|
||||||
|
### type: repo
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_repo_get_deb(php, name, items) -%}
|
||||||
|
{{- fn.get_val_by_type(php, name, items, 'deb', 'repo', '') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'key'
|
||||||
|
### type: repo
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_repo_get_key(php, name, items) -%}
|
||||||
|
{{- fn.get_val_by_type(php, name, items, 'key', 'repo', '') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
|
||||||
|
{# --------------------------------------------- CUSTOM --------------------------------------- -#}
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'command'
|
||||||
|
### type: custom
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_custom_get_command(php, name, items) -%}
|
||||||
|
{{- fn.get_val_by_type(php, name, items, 'command', 'custom', '') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
|
||||||
|
{# --------------------------------------------- NPM ------------------------------------------ -#}
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'package'
|
||||||
|
### type: npm
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_npm_get_package(php, name, items) -%}
|
||||||
|
{{- fn.get_val_by_type(php, name, items, 'package', 'npm', name) -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'version'
|
||||||
|
### type: npm
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_npm_get_version(php, name, items) -%}
|
||||||
|
{%- set version = fn.get_val_by_type(php, name, items, 'version', 'npm', '') -%}
|
||||||
|
{%- if version | length -%}
|
||||||
|
{{- '@' ~ version -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- '' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'binary'
|
||||||
|
### type: npm
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_npm_get_binary(php, name, items) -%}
|
||||||
|
{{- fn.get_val_by_type(php, name, items, 'binary', 'npm', '') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
|
||||||
|
{# --------------------------------------------- COMPOSER ------------------------------------- -#}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'composer'
|
||||||
|
### type: composer
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_composer_get_composer(php, name, items) -%}
|
||||||
|
{{- fn.get_val_by_type(php, name, items, 'composer', 'composer', '') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'package'
|
||||||
|
### type: composer
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_composer_get_package(php, name, items) -%}
|
||||||
|
{{- fn.get_val_by_type(php, name, items, 'package', 'composer', '') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'version'
|
||||||
|
### type: composer
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_composer_get_version(php, name, items) -%}
|
||||||
|
{%- set version = fn.get_val_by_type(php, name, items, 'version', 'composer', '') -%}
|
||||||
|
{%- if version | length -%}
|
||||||
|
{{- ':' ~ version -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- '' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'binary'
|
||||||
|
### type: composer
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_composer_get_binary(php, name, items) -%}
|
||||||
|
{{- fn.get_val_by_type(php, name, items, 'binary', 'composer', '') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
|
||||||
|
{# --------------------------------------------- RUBYGEM -------------------------------------- -#}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'package'
|
||||||
|
### type: rubygem
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_rubygem_get_package(php, name, items) -%}
|
||||||
|
{{- fn.get_val_by_type(php, name, items, 'package', 'rubygem', '') -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'version'
|
||||||
|
### type: rubygem
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_rubygem_get_version(php, name, items) -%}
|
||||||
|
{%- set version = fn.get_val_by_type(php, name, items, 'version', 'rubygem', '') -%}
|
||||||
|
{%- if version | length -%}
|
||||||
|
{{- ' -v ' ~ version -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- '' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
|
||||||
|
{# --------------------------------------------- PIP ------------------------------------------ -#}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'package'
|
||||||
|
### type: pip
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_pip_get_package(php, name, items) -%}
|
||||||
|
{{- fn.get_val_by_type(php, name, items, 'package', 'pip', name) -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'version'
|
||||||
|
### type: pip
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_pip_get_version(php, name, items) -%}
|
||||||
|
{%- set version = fn.get_val_by_type(php, name, items, 'version', 'pip', '') -%}
|
||||||
|
{%- if version | length -%}
|
||||||
|
{{- '==' ~ version -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- '' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
|
||||||
|
{# --------------------------------------------- APT ------------------------------------------ -#}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
###
|
||||||
|
### Get 'package'
|
||||||
|
### type: apt
|
||||||
|
###
|
||||||
|
-#}
|
||||||
|
{%- macro tool_apt_get_package(php, name, items) -%}
|
||||||
|
{%- if is_not_disabled(php, name, items) -%}
|
||||||
|
{{- fn.get_val_by_type(php, name, items, 'package', 'apt', '') -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endmacro -%}
|
||||||
90
.ansible/jinja2/macros.j2
Normal file
90
.ansible/jinja2/macros.j2
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
{##################################################################################################
|
||||||
|
# HELPER MACROS
|
||||||
|
##################################################################################################}
|
||||||
|
|
||||||
|
{#
|
||||||
|
### Get generic string value of key if type value matches.
|
||||||
|
###
|
||||||
|
### php: The PHP Version
|
||||||
|
### name: The item name
|
||||||
|
### items: The items_available list
|
||||||
|
### key: The key to retrieve the value for
|
||||||
|
### type: The type key must match this type string
|
||||||
|
### default: Default value to return if none was found
|
||||||
|
#}
|
||||||
|
{%- macro get_val_by_type(php, name, items, key, type, default='' ) -%}
|
||||||
|
{#- Default return value -#}
|
||||||
|
{%- set result = default -%}
|
||||||
|
|
||||||
|
{#- PHP Version specific -#}
|
||||||
|
{%- if php in items[name] and items[name][php]['type'] == type -%}
|
||||||
|
{%- if key in items[name][php] and items[name][php][key] -%}
|
||||||
|
{%- set result = items[name][php][key] -%}
|
||||||
|
{%- elif key in items[name]['all'] and items[name]['all'][key] -%}
|
||||||
|
{%- set result = items[name]['all'][key] -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{#- Defined in 'all' -#}
|
||||||
|
{%- elif 'all' in items[name] and items[name]['all']['type'] == type -%}
|
||||||
|
{%- if key in items[name]['all'] and items[name]['all'][key] -%}
|
||||||
|
{%- set result = items[name]['all'][key] -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{{- result -}}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
### Get generic string value of key.
|
||||||
|
###
|
||||||
|
### php: The PHP Version
|
||||||
|
### name: The item name
|
||||||
|
### items: The items_available list
|
||||||
|
### key: The key to retrieve the value for
|
||||||
|
### default: Default value to return if none was found
|
||||||
|
-#}
|
||||||
|
{%- macro get_val(php, name, items, key, default='') -%}
|
||||||
|
{%- if php in items[name] and key in items[name][php] and items[name][php][key] -%}
|
||||||
|
{{- items[name][php][key] -}}
|
||||||
|
{%- elif 'all' in items[name] and key in items[name]['all'] and items[name]['all'][key] -%}
|
||||||
|
{{- items[name]['all'][key] -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- default -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{#-
|
||||||
|
### Get generic list value (space separated) of not disabled PHP versions.
|
||||||
|
###
|
||||||
|
### Returns jsonified string of a list.
|
||||||
|
###
|
||||||
|
### Usage:
|
||||||
|
### {%- set list = [] -%}
|
||||||
|
### {%- for val in get_enabled_list(php_version, item, items_available) | from_json -%}
|
||||||
|
### {%- if val -%}
|
||||||
|
### {{- list.append(val) -}}
|
||||||
|
### {%- endif -%}
|
||||||
|
### {%- endfor -%}
|
||||||
|
###
|
||||||
|
### php: The PHP Version
|
||||||
|
### name: The item name
|
||||||
|
### items: The items_available list
|
||||||
|
### key: The key to retrieve the value for
|
||||||
|
-#}
|
||||||
|
{%- macro get_list_if_enabled(php, name, items, key) -%}
|
||||||
|
{%- set list = [] %}
|
||||||
|
{# Not disabled #}
|
||||||
|
{%- if ('disabled' not in items[name]) or (php not in items[name]['disabled']) -%}
|
||||||
|
{#- Version specific build dependency available? -#}
|
||||||
|
{%- if php in items[name] and key in items[name][php] -%}
|
||||||
|
{%- for val in items[name][php][key] -%}
|
||||||
|
{{- list.append(val) -}}
|
||||||
|
{%- endfor -%}
|
||||||
|
{#- Generic build dependency available? -#}
|
||||||
|
{%- elif 'all' in items[name] and key in items[name]['all'] -%}
|
||||||
|
{%- for val in items[name]['all'][key] -%}
|
||||||
|
{{- list.append(val) -}}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{{- list | to_json -}}
|
||||||
|
{%- endmacro -%}
|
||||||
95
.github/workflows/action-schedule_master.yml
vendored
95
.github/workflows/action-schedule_master.yml
vendored
@@ -20,14 +20,14 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (1/8) Determine parameter settings
|
# (1/9) Determine parameter settings
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
params:
|
params:
|
||||||
uses: ./.github/workflows/params-nightly_master.yml
|
uses: ./.github/workflows/params-nightly_master.yml
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (2/8) Configure Build and Deploy Matrices
|
# (2/9) Configure Build and Deploy Matrices
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
configure:
|
configure:
|
||||||
needs: [params]
|
needs: [params]
|
||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (3/8) Build & Test base
|
# (3/9) Build & Test base
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-base:
|
build-base:
|
||||||
needs:
|
needs:
|
||||||
@@ -72,7 +72,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (4/8) Build & Test mods
|
# (4/9) Build & Test mods
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-mods:
|
build-mods:
|
||||||
needs:
|
needs:
|
||||||
@@ -101,7 +101,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (5/8) Build & Test prod
|
# (5/9) Build & Test prod
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-prod:
|
build-prod:
|
||||||
needs:
|
needs:
|
||||||
@@ -130,9 +130,9 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (6/8) Build & Test work
|
# (6/9) Build & Test slim
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-work:
|
build-slim:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- build-prod
|
- build-prod
|
||||||
@@ -143,9 +143,38 @@ jobs:
|
|||||||
upload_artifact: true
|
upload_artifact: true
|
||||||
matrix: ${{ needs.configure.outputs.matrix_build }}
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
stage: work
|
stage: slim
|
||||||
stage_prev: prod
|
stage_prev: prod
|
||||||
|
|
||||||
|
test-slim:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- build-slim
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
|
||||||
|
with:
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
|
stage: slim
|
||||||
|
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------------------------
|
||||||
|
# (7/9) Build & Test work
|
||||||
|
# -----------------------------------------------------------------------------------------------
|
||||||
|
build-work:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- build-slim
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
|
||||||
|
with:
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
run_tests: false
|
||||||
|
upload_artifact: true
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
|
stage: work
|
||||||
|
stage_prev: slim
|
||||||
|
|
||||||
test-work:
|
test-work:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
@@ -159,14 +188,15 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (7/8) Push images
|
# (8/9) Push images
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
push-base:
|
push-base:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -183,8 +213,9 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -201,8 +232,9 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -215,12 +247,32 @@ jobs:
|
|||||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
push-slim:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- test-base
|
||||||
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
|
- test-work
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
|
with:
|
||||||
|
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
|
stage: slim
|
||||||
|
secrets:
|
||||||
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
push-work:
|
push-work:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -235,7 +287,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (8/8) Push Manifests
|
# (9/9) Push Manifests
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
manifest-base:
|
manifest-base:
|
||||||
needs:
|
needs:
|
||||||
@@ -282,6 +334,21 @@ jobs:
|
|||||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
manifest-slim:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- push-slim
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
|
||||||
|
with:
|
||||||
|
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_deploy }}
|
||||||
|
versions: ${{ needs.configure.outputs.versions }}
|
||||||
|
stage: slim
|
||||||
|
secrets:
|
||||||
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
manifest-work:
|
manifest-work:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
|
|||||||
95
.github/workflows/action-schedule_tags.yml
vendored
95
.github/workflows/action-schedule_tags.yml
vendored
@@ -20,14 +20,14 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (1/8) Determine parameter settings
|
# (1/9) Determine parameter settings
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
params:
|
params:
|
||||||
uses: ./.github/workflows/params-nightly_tags.yml
|
uses: ./.github/workflows/params-nightly_tags.yml
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (2/8) Configure Build and Deploy Matrices
|
# (2/9) Configure Build and Deploy Matrices
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
configure:
|
configure:
|
||||||
needs: [params]
|
needs: [params]
|
||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (3/8) Build & Test base
|
# (3/9) Build & Test base
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-base:
|
build-base:
|
||||||
needs:
|
needs:
|
||||||
@@ -72,7 +72,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (4/8) Build & Test mods
|
# (4/9) Build & Test mods
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-mods:
|
build-mods:
|
||||||
needs:
|
needs:
|
||||||
@@ -101,7 +101,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (5/8) Build & Test prod
|
# (5/9) Build & Test prod
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-prod:
|
build-prod:
|
||||||
needs:
|
needs:
|
||||||
@@ -130,9 +130,9 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (6/8) Build & Test work
|
# (6/9) Build & Test slim
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-work:
|
build-slim:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- build-prod
|
- build-prod
|
||||||
@@ -143,9 +143,38 @@ jobs:
|
|||||||
upload_artifact: true
|
upload_artifact: true
|
||||||
matrix: ${{ needs.configure.outputs.matrix_build }}
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
stage: work
|
stage: slim
|
||||||
stage_prev: prod
|
stage_prev: prod
|
||||||
|
|
||||||
|
test-slim:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- build-slim
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
|
||||||
|
with:
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
|
stage: slim
|
||||||
|
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------------------------
|
||||||
|
# (7/9) Build & Test work
|
||||||
|
# -----------------------------------------------------------------------------------------------
|
||||||
|
build-work:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- build-slim
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
|
||||||
|
with:
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
run_tests: false
|
||||||
|
upload_artifact: true
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
|
stage: work
|
||||||
|
stage_prev: slim
|
||||||
|
|
||||||
test-work:
|
test-work:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
@@ -159,14 +188,15 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (7/8) Push images
|
# (8/9) Push images
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
push-base:
|
push-base:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -183,8 +213,9 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -201,8 +232,9 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -215,12 +247,32 @@ jobs:
|
|||||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
push-slim:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- test-base
|
||||||
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
|
- test-work
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
|
with:
|
||||||
|
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
|
stage: slim
|
||||||
|
secrets:
|
||||||
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
push-work:
|
push-work:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -235,7 +287,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (8/8) Push Manifests
|
# (9/9) Push Manifests
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
manifest-base:
|
manifest-base:
|
||||||
needs:
|
needs:
|
||||||
@@ -282,6 +334,21 @@ jobs:
|
|||||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
manifest-slim:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- push-slim
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
|
||||||
|
with:
|
||||||
|
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_deploy }}
|
||||||
|
versions: ${{ needs.configure.outputs.versions }}
|
||||||
|
stage: slim
|
||||||
|
secrets:
|
||||||
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
manifest-work:
|
manifest-work:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
|
|||||||
95
.github/workflows/action.yml
vendored
95
.github/workflows/action.yml
vendored
@@ -20,14 +20,14 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (1/8) Determine parameter settings
|
# (1/9) Determine parameter settings
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
params:
|
params:
|
||||||
uses: ./.github/workflows/params.yml
|
uses: ./.github/workflows/params.yml
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (2/8) Configure Build and Deploy Matrices
|
# (2/9) Configure Build and Deploy Matrices
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
configure:
|
configure:
|
||||||
needs: [params]
|
needs: [params]
|
||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (3/8) Build & Test base
|
# (3/9) Build & Test base
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-base:
|
build-base:
|
||||||
needs:
|
needs:
|
||||||
@@ -72,7 +72,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (4/8) Build & Test mods
|
# (4/9) Build & Test mods
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-mods:
|
build-mods:
|
||||||
needs:
|
needs:
|
||||||
@@ -101,7 +101,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (5/8) Build & Test prod
|
# (5/9) Build & Test prod
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-prod:
|
build-prod:
|
||||||
needs:
|
needs:
|
||||||
@@ -130,9 +130,9 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (6/8) Build & Test work
|
# (6/9) Build & Test slim
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
build-work:
|
build-slim:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- build-prod
|
- build-prod
|
||||||
@@ -143,9 +143,38 @@ jobs:
|
|||||||
upload_artifact: true
|
upload_artifact: true
|
||||||
matrix: ${{ needs.configure.outputs.matrix_build }}
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
stage: work
|
stage: slim
|
||||||
stage_prev: prod
|
stage_prev: prod
|
||||||
|
|
||||||
|
test-slim:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- build-slim
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
|
||||||
|
with:
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
|
stage: slim
|
||||||
|
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------------------------
|
||||||
|
# (7/9) Build & Test work
|
||||||
|
# -----------------------------------------------------------------------------------------------
|
||||||
|
build-work:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- build-slim
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
|
||||||
|
with:
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
run_tests: false
|
||||||
|
upload_artifact: true
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
|
stage: work
|
||||||
|
stage_prev: slim
|
||||||
|
|
||||||
test-work:
|
test-work:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
@@ -159,14 +188,15 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (7/8) Push images
|
# (8/9) Push images
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
push-base:
|
push-base:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -183,8 +213,9 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -201,8 +232,9 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -215,12 +247,32 @@ jobs:
|
|||||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
push-slim:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- test-base
|
||||||
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
|
- test-work
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
|
with:
|
||||||
|
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||||
|
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||||
|
stage: slim
|
||||||
|
secrets:
|
||||||
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
push-work:
|
push-work:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
- test-base
|
- test-base
|
||||||
- test-prod
|
|
||||||
- test-mods
|
- test-mods
|
||||||
|
- test-prod
|
||||||
|
- test-slim
|
||||||
- test-work
|
- test-work
|
||||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
|
||||||
with:
|
with:
|
||||||
@@ -235,7 +287,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
# (8/8) Push Manifests
|
# (9/9) Push Manifests
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
manifest-base:
|
manifest-base:
|
||||||
needs:
|
needs:
|
||||||
@@ -282,6 +334,21 @@ jobs:
|
|||||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
manifest-slim:
|
||||||
|
needs:
|
||||||
|
- configure
|
||||||
|
- push-slim
|
||||||
|
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
|
||||||
|
with:
|
||||||
|
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
|
||||||
|
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
|
||||||
|
matrix: ${{ needs.configure.outputs.matrix_deploy }}
|
||||||
|
versions: ${{ needs.configure.outputs.versions }}
|
||||||
|
stage: slim
|
||||||
|
secrets:
|
||||||
|
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
manifest-work:
|
manifest-work:
|
||||||
needs:
|
needs:
|
||||||
- configure
|
- configure
|
||||||
|
|||||||
473
Dockerfiles/slim/Dockerfile-5.2
Normal file
473
Dockerfiles/slim/Dockerfile-5.2
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:5.2-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until \
|
||||||
|
&& echo "deb [trusted=yes] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mysql-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '5.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '5.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:5.2-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-5.2.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-5.2.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '5.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '5.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.2' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="5.2-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 5.2-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 5.2-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
473
Dockerfiles/slim/Dockerfile-5.3
Normal file
473
Dockerfiles/slim/Dockerfile-5.3
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:5.3-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until \
|
||||||
|
&& echo "deb [trusted=yes] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mysql-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '5.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '5.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:5.3-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-5.3.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-5.3.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '5.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '5.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.3' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="5.3-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 5.3-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 5.3-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
473
Dockerfiles/slim/Dockerfile-5.4
Normal file
473
Dockerfiles/slim/Dockerfile-5.4
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:5.4-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until \
|
||||||
|
&& echo "deb [trusted=yes] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mysql-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '5.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '5.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:5.4-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-5.4.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-5.4.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '5.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '5.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.4' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="5.4-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 5.4-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 5.4-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
473
Dockerfiles/slim/Dockerfile-5.5
Normal file
473
Dockerfiles/slim/Dockerfile-5.5
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:5.5-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until \
|
||||||
|
&& echo "deb [trusted=yes] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mysql-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '5.5' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '5.5' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:5.5-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-5.5.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-5.5.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '5.5' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '5.5' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.5' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="5.5-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 5.5-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 5.5-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
477
Dockerfiles/slim/Dockerfile-5.6
Normal file
477
Dockerfiles/slim/Dockerfile-5.6
Normal file
@@ -0,0 +1,477 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:5.6-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
|
||||||
|
&& echo "deb http://ftp.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mysql-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients \
|
||||||
|
mongo-tools; \
|
||||||
|
else \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '5.6' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '5.6' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:5.6-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-5.6.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-5.6.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '5.6' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '5.6' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.6' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="5.6-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 5.6-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 5.6-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
477
Dockerfiles/slim/Dockerfile-7.0
Normal file
477
Dockerfiles/slim/Dockerfile-7.0
Normal file
@@ -0,0 +1,477 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:7.0-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
|
||||||
|
&& echo "deb http://ftp.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mysql-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients \
|
||||||
|
mongo-tools; \
|
||||||
|
else \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-clients; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '7.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '7.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:7.0-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-7.0.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-7.0.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '7.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '7.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.0' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="7.0-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 7.0-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 7.0-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
473
Dockerfiles/slim/Dockerfile-7.1
Normal file
473
Dockerfiles/slim/Dockerfile-7.1
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:7.1-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
|
||||||
|
&& echo "deb http://ftp.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mariadb-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-org-tools \
|
||||||
|
mongodb-org-shell \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '7.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '7.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:7.1-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-7.1.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-7.1.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '7.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '7.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.1' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="7.1-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 7.1-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 7.1-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
473
Dockerfiles/slim/Dockerfile-7.2
Normal file
473
Dockerfiles/slim/Dockerfile-7.2
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:7.2-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
|
||||||
|
&& echo "deb http://ftp.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mariadb-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-org-tools \
|
||||||
|
mongodb-org-shell \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '7.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '7.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:7.2-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-7.2.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-7.2.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '7.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '7.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.2' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="7.2-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 7.2-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 7.2-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
473
Dockerfiles/slim/Dockerfile-7.3
Normal file
473
Dockerfiles/slim/Dockerfile-7.3
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:7.3-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
|
||||||
|
&& echo "deb http://ftp.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mariadb-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-org-tools \
|
||||||
|
mongodb-org-shell \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '7.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '7.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:7.3-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-7.3.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-7.3.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '7.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '7.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.3' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="7.3-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 7.3-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 7.3-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
473
Dockerfiles/slim/Dockerfile-7.4
Normal file
473
Dockerfiles/slim/Dockerfile-7.4
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:7.4-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
|
||||||
|
&& echo "deb http://ftp.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mariadb-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-org-tools \
|
||||||
|
mongodb-org-shell \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '7.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '7.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:7.4-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-7.4.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-7.4.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '7.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '7.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.4' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="7.4-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 7.4-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 7.4-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
473
Dockerfiles/slim/Dockerfile-8.0
Normal file
473
Dockerfiles/slim/Dockerfile-8.0
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:8.0-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
|
||||||
|
&& echo "deb http://ftp.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mariadb-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-org-tools \
|
||||||
|
mongodb-org-shell \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '8.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '8.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:8.0-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-8.0.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-8.0.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '8.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '8.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.0' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="8.0-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 8.0-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 8.0-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
473
Dockerfiles/slim/Dockerfile-8.1
Normal file
473
Dockerfiles/slim/Dockerfile-8.1
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:8.1-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
|
||||||
|
&& echo "deb http://ftp.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mariadb-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-org-tools \
|
||||||
|
mongodb-org-shell \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '8.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '8.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:8.1-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-8.1.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-8.1.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '8.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '8.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.1' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="8.1-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 8.1-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 8.1-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
473
Dockerfiles/slim/Dockerfile-8.2
Normal file
473
Dockerfiles/slim/Dockerfile-8.2
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
# vi: ft=dockerfile
|
||||||
|
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 1/4: Devilbox slim image (BASE BUILDER)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Installs all cli tools required to run Devilbox and its intranet
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:8.2-prod as devilbox-slim-base-builder
|
||||||
|
|
||||||
|
###
|
||||||
|
### Install apt Tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add apt repositories
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
|
||||||
|
&& echo "deb http://ftp.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list \
|
||||||
|
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Add common build tools
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
mariadb-client \
|
||||||
|
redis-tools \
|
||||||
|
sqlite3
|
||||||
|
|
||||||
|
###
|
||||||
|
### Devilbox required cli tools from group_vars (slim.yml)
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
blackfire-agent \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
|
||||||
|
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
|
||||||
|
&& chmod +x mhsendmail_linux_amd64 \
|
||||||
|
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
|
||||||
|
else \
|
||||||
|
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
|
||||||
|
&& chmod +x /usr/local/bin/mhsendmail; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
|
||||||
|
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
mongodb-org-tools \
|
||||||
|
mongodb-org-shell \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '8.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
|
||||||
|
&& cd /usr/local/src/mysqldump-secure \
|
||||||
|
&& git checkout $(git describe --abbrev=0 --tags) \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
|
||||||
|
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
|
||||||
|
&& touch /var/log/mysqldump-secure.log \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.conf \
|
||||||
|
&& chmod 0400 /etc/mysqldump-secure.cnf \
|
||||||
|
&& chmod 0644 /var/log/mysqldump-secure.log \
|
||||||
|
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /usr/local/src/mysqldump-secure \
|
||||||
|
\
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
|
||||||
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
|
||||||
|
&& apt-get update \
|
||||||
|
\
|
||||||
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
postgresql-client \
|
||||||
|
\
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& if echo '8.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare libraries for copying (keep symlinks)
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
&& USR_LIB_DIR="/usr/lib" \
|
||||||
|
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
|
\
|
||||||
|
&& mkdir /tmp/lib-gnu \
|
||||||
|
&& mkdir /tmp/usr-lib \
|
||||||
|
&& mkdir /tmp/usr-lib-gnu \
|
||||||
|
\
|
||||||
|
&& LIB_GNU="libreadline" \
|
||||||
|
&& USR_LIB="libsnappy libtcmalloc libv8" \
|
||||||
|
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit" \
|
||||||
|
\
|
||||||
|
&& for lib in ${LIB_GNU}; do \
|
||||||
|
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB}; do \
|
||||||
|
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
|
||||||
|
fi \
|
||||||
|
done \
|
||||||
|
&& for lib in ${USR_LIB_GNU}; do \
|
||||||
|
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
|
||||||
|
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
|
||||||
|
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 2/4: Devilbox slim image (BASE)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copies all cli tools required to run Devilbox and its intranet into a clean image
|
||||||
|
###
|
||||||
|
FROM devilbox/php-fpm:8.2-prod as devilbox-slim-base
|
||||||
|
ARG ARCH
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy libraries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
|
||||||
|
|
||||||
|
###
|
||||||
|
### System files
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
|
||||||
|
|
||||||
|
###
|
||||||
|
### Blackfire
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mhsendmail
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy Mongo client
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mongo* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysql* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy mysqldump-secure
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
|
||||||
|
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy PostgreSQL client
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
|
||||||
|
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo
|
||||||
|
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/libpq.so* /usr/lib/${ARCH}-linux-gnu/
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
|
||||||
|
#COPY --from=devilbox-slim-base-builder /etc/perl /etc/perl
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl-base /usr/lib/${ARCH}-linux-gnu/perl-base
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/lib/${ARCH}-linux-gnu/perl5 /usr/lib/${ARCH}-linux-gnu/perl5
|
||||||
|
#COPY --from=devilbox-slim-base-builder /usr/share/postgresql /usr/share/postgresql
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy redis* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy sqlite* binaries
|
||||||
|
###
|
||||||
|
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
|
||||||
|
|
||||||
|
###
|
||||||
|
### Copy configuration files
|
||||||
|
###
|
||||||
|
COPY ./data/php-ini.d/php-8.2.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
|
||||||
|
COPY ./data/php-fpm.conf/php-fpm-8.2.conf /usr/local/etc/php-fpm.conf
|
||||||
|
|
||||||
|
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
|
||||||
|
COPY ./data/bash-devilbox /etc/bash-devilbox
|
||||||
|
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
|
||||||
|
|
||||||
|
###
|
||||||
|
### Configure Bash
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& { \
|
||||||
|
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
|
||||||
|
echo "export PATH"; \
|
||||||
|
echo ". /etc/bash-devilbox"; \
|
||||||
|
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
|
||||||
|
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
|
||||||
|
echo " if [ -r \"\${f}\" ]; then"; \
|
||||||
|
echo " . \"\${f}\""; \
|
||||||
|
echo " fi"; \
|
||||||
|
echo " done"; \
|
||||||
|
echo " unset f"; \
|
||||||
|
echo "fi"; \
|
||||||
|
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
|
||||||
|
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 3/4: Devilbox slim image (BASE TEST)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Test all Devilbox cli utils if copying was successful
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as devilbox-slim-base-test
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysql --version \
|
||||||
|
&& redis-cli --version \
|
||||||
|
&& sqlite3 --version
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if available tools slim
|
||||||
|
###
|
||||||
|
|
||||||
|
# -------------------- blackfire --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& blackfire version \
|
||||||
|
&& blackfire-agent -v \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mhsendmail --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mongo_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '8.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
mongofiles --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- mysqldumpsecure --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# -------------------- pgsql_client --------------------
|
||||||
|
RUN set -eux \
|
||||||
|
&& if echo '8.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
|
||||||
|
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
pg_isready --version; \
|
||||||
|
fi \
|
||||||
|
\
|
||||||
|
&& true
|
||||||
|
|
||||||
|
###
|
||||||
|
### Re-activate modules which have been deactivated in mods (for testing).
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
|
||||||
|
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
|
||||||
|
fi \
|
||||||
|
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
|
||||||
|
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
### Check if PHP still works
|
||||||
|
###
|
||||||
|
RUN set -eux \
|
||||||
|
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
|
||||||
|
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.2' \
|
||||||
|
&& /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 \
|
||||||
|
&& 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
###
|
||||||
|
### Stage 4/4: Devilbox slim image (FINAL)
|
||||||
|
###
|
||||||
|
########################################################################################################################
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
###
|
||||||
|
### Prepare final base image (STAGE: slim)
|
||||||
|
###
|
||||||
|
FROM devilbox-slim-base as slim
|
||||||
|
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||||
|
|
||||||
|
###
|
||||||
|
### Labels
|
||||||
|
###
|
||||||
|
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
|
||||||
|
#LABEL "org.opencontainers.image.created"=""
|
||||||
|
#LABEL "org.opencontainers.image.version"=""
|
||||||
|
#LABEL "org.opencontainers.image.revision"=""
|
||||||
|
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
|
||||||
|
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
|
||||||
|
LABEL "org.opencontainers.image.vendor"="devilbox"
|
||||||
|
LABEL "org.opencontainers.image.licenses"="MIT"
|
||||||
|
LABEL "org.opencontainers.image.ref.name"="8.2-slim"
|
||||||
|
LABEL "org.opencontainers.image.title"="PHP-FPM 8.2-slim"
|
||||||
|
LABEL "org.opencontainers.image.description"="PHP-FPM 8.2-slim"
|
||||||
|
|
||||||
|
###
|
||||||
|
### Volumes
|
||||||
|
###
|
||||||
|
VOLUME /shared/backups
|
||||||
|
VOLUME /var/log/php
|
||||||
|
VOLUME /var/mail
|
||||||
|
|
||||||
|
###
|
||||||
|
### Ports
|
||||||
|
###
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
###
|
||||||
|
### Where to start inside the container
|
||||||
|
###
|
||||||
|
WORKDIR /shared/httpd
|
||||||
|
|
||||||
|
###
|
||||||
|
### Entrypoint
|
||||||
|
###
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 5.2-work
|
; # Devilbox PHP defaults for 5.2-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 5.3-work
|
; # Devilbox PHP defaults for 5.3-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 5.4-work
|
; # Devilbox PHP defaults for 5.4-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 5.5-work
|
; # Devilbox PHP defaults for 5.5-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 5.6-work
|
; # Devilbox PHP defaults for 5.6-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 7.0-work
|
; # Devilbox PHP defaults for 7.0-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 7.1-work
|
; # Devilbox PHP defaults for 7.1-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 7.2-work
|
; # Devilbox PHP defaults for 7.2-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 7.3-work
|
; # Devilbox PHP defaults for 7.3-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 7.4-work
|
; # Devilbox PHP defaults for 7.4-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 8.0-work
|
; # Devilbox PHP defaults for 8.0-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 8.1-work
|
; # Devilbox PHP defaults for 8.1-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
; ############################################################
|
; ############################################################
|
||||||
; # Devilbox PHP defaults for 8.2-work
|
; # Devilbox PHP defaults for 8.2-slim
|
||||||
; ############################################################
|
; ############################################################
|
||||||
|
|
||||||
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
29
Makefile
29
Makefile
@@ -20,6 +20,7 @@ include $(MAKEFILES)
|
|||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
# Default configuration
|
# Default configuration
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
DOCKER_PULL_BASE_IMAGES_IGNORE = devilbox-slim-base devilbox-work-help devilbox-work-tools
|
||||||
# Own vars
|
# Own vars
|
||||||
TAG = latest
|
TAG = latest
|
||||||
|
|
||||||
@@ -37,12 +38,14 @@ DOCKER_TAG = $(VERSION)-$(STAGE)
|
|||||||
BASE_TAG = $(VERSION)-base
|
BASE_TAG = $(VERSION)-base
|
||||||
MODS_TAG = $(VERSION)-mods
|
MODS_TAG = $(VERSION)-mods
|
||||||
PROD_TAG = $(VERSION)-prod
|
PROD_TAG = $(VERSION)-prod
|
||||||
|
SLIM_TAG = $(VERSION)-slim
|
||||||
WORK_TAG = $(VERSION)-work
|
WORK_TAG = $(VERSION)-work
|
||||||
else
|
else
|
||||||
DOCKER_TAG = $(VERSION)-$(STAGE)-$(TAG)
|
DOCKER_TAG = $(VERSION)-$(STAGE)-$(TAG)
|
||||||
BASE_TAG = $(VERSION)-base-$(TAG)
|
BASE_TAG = $(VERSION)-base-$(TAG)
|
||||||
MODS_TAG = $(VERSION)-mods-$(TAG)
|
MODS_TAG = $(VERSION)-mods-$(TAG)
|
||||||
PROD_TAG = $(VERSION)-prod-$(TAG)
|
PROD_TAG = $(VERSION)-prod-$(TAG)
|
||||||
|
SLIM_TAG = $(VERSION)-slim-$(TAG)
|
||||||
WORK_TAG = $(VERSION)-work-$(TAG)
|
WORK_TAG = $(VERSION)-work-$(TAG)
|
||||||
endif
|
endif
|
||||||
ARCH = linux/amd64
|
ARCH = linux/amd64
|
||||||
@@ -130,13 +133,13 @@ endif
|
|||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: check-stage-is-set
|
build: check-stage-is-set
|
||||||
build: check-parent-image-exists
|
build: check-parent-image-exists
|
||||||
build: ARGS+=--build-arg EXT_DIR=$(EXT_DIR)
|
build: ARGS+=--build-arg EXT_DIR=$(EXT_DIR) --build-arg ARCH=$(shell if [ "$(ARCH)" = "linux/amd64" ]; then echo "x86_64"; else echo "aarch64"; fi)
|
||||||
build: docker-arch-build
|
build: docker-arch-build
|
||||||
|
|
||||||
.PHONY: rebuild
|
.PHONY: rebuild
|
||||||
rebuild: check-stage-is-set
|
rebuild: check-stage-is-set
|
||||||
rebuild: check-parent-image-exists
|
rebuild: check-parent-image-exists
|
||||||
rebuild: ARGS+=--build-arg EXT_DIR=$(EXT_DIR)
|
rebuild: ARGS+=--build-arg EXT_DIR=$(EXT_DIR) --build-arg ARCH=$(shell if [ "$(ARCH)" = "linux/amd64" ]; then echo "x86_64"; else echo "aarch64"; fi)
|
||||||
rebuild: docker-arch-rebuild
|
rebuild: docker-arch-rebuild
|
||||||
|
|
||||||
.PHONY: push
|
.PHONY: push
|
||||||
@@ -184,8 +187,8 @@ manifest-push: docker-manifest-push
|
|||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: check-stage-is-set
|
test: check-stage-is-set
|
||||||
test: check-current-image-exists
|
test: check-current-image-exists
|
||||||
test: gen-readme
|
|
||||||
test: test-integration
|
test: test-integration
|
||||||
|
test: gen-readme
|
||||||
|
|
||||||
.PHONY: test-integration
|
.PHONY: test-integration
|
||||||
test-integration:
|
test-integration:
|
||||||
@@ -291,8 +294,8 @@ check-stage-is-set:
|
|||||||
echo "Exiting."; \
|
echo "Exiting."; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
@if [ "$(STAGE)" != "base" ] && [ "$(STAGE)" != "mods" ] && [ "$(STAGE)" != "prod" ] && [ "$(STAGE)" != "work" ]; then \
|
@if [ "$(STAGE)" != "base" ] && [ "$(STAGE)" != "mods" ] && [ "$(STAGE)" != "prod" ] && [ "$(STAGE)" != "slim" ] && [ "$(STAGE)" != "work" ]; then \
|
||||||
echo "Error, Flavour can only be one of 'base', 'mods', 'prod', or 'work'."; \
|
echo "Error, Flavour can only be one of 'base', 'mods', 'prod', 'slim' or 'work'."; \
|
||||||
echo "Exiting."; \
|
echo "Exiting."; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
@@ -330,6 +333,22 @@ check-current-image-exists:
|
|||||||
check-parent-image-exists: check-stage-is-set
|
check-parent-image-exists: check-stage-is-set
|
||||||
check-parent-image-exists:
|
check-parent-image-exists:
|
||||||
@if [ "$(STAGE)" = "work" ]; then \
|
@if [ "$(STAGE)" = "work" ]; then \
|
||||||
|
if [ "$$( docker images -q $(IMAGE):$(SLIM_TAG) )" = "" ]; then \
|
||||||
|
>&2 echo "Docker image '$(IMAGE):$(SLIM_TAG)' was not found locally."; \
|
||||||
|
>&2 echo "Either build it first or explicitly pull it from Dockerhub."; \
|
||||||
|
>&2 echo "This is a safeguard to not automatically pull the Docker image."; \
|
||||||
|
>&2 echo; \
|
||||||
|
exit 1; \
|
||||||
|
fi; \
|
||||||
|
OS="$$( docker image inspect $(IMAGE):$(SLIM_TAG) --format '{{.Os}}' )"; \
|
||||||
|
ARCH="$$( docker image inspect $(IMAGE):$(SLIM_TAG) --format '{{.Architecture}}' )"; \
|
||||||
|
if [ "$${OS}/$${ARCH}" != "$(ARCH)" ]; then \
|
||||||
|
>&2 echo "Docker image '$(IMAGE):$(SLIM_TAG)' has invalid architecture: $${OS}/$${ARCH}"; \
|
||||||
|
>&2 echo "Expected: $(ARCH)"; \
|
||||||
|
>&2 echo; \
|
||||||
|
exit 1; \
|
||||||
|
fi; \
|
||||||
|
elif [ "$(STAGE)" = "slim" ]; then \
|
||||||
if [ "$$( docker images -q $(IMAGE):$(PROD_TAG) )" = "" ]; then \
|
if [ "$$( docker images -q $(IMAGE):$(PROD_TAG) )" = "" ]; then \
|
||||||
>&2 echo "Docker image '$(IMAGE):$(PROD_TAG)' was not found locally."; \
|
>&2 echo "Docker image '$(IMAGE):$(PROD_TAG)' was not found locally."; \
|
||||||
>&2 echo "Either build it first or explicitly pull it from Dockerhub."; \
|
>&2 echo "Either build it first or explicitly pull it from Dockerhub."; \
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ MYPY_ARGS = --strict --disable-error-code no-any-return
|
|||||||
|
|
||||||
PYLINT_DIR = *.py
|
PYLINT_DIR = *.py
|
||||||
PYLINT_PIP_PKGS = yamllint
|
PYLINT_PIP_PKGS = yamllint
|
||||||
PYLINT_ARGS = --disable=invalid-name
|
PYLINT_ARGS = --disable=invalid-name,duplicate-code
|
||||||
|
|
||||||
PYCODE_ARGS = --max-line-length=100
|
PYCODE_ARGS = --max-line-length=100
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,12 @@ def get_modules(selected_modules: List[str], ignore_dependencies: bool) -> List[
|
|||||||
if not item.name.startswith(".") and item.is_dir():
|
if not item.name.startswith(".") and item.is_dir():
|
||||||
data = get_module_options(item.name)
|
data = get_module_options(item.name)
|
||||||
modules.append(
|
modules.append(
|
||||||
{"dir": item.name, "name": data["name"], "deps": data["depends_build"]}
|
{
|
||||||
|
"dir": item.name,
|
||||||
|
"name": data["name"],
|
||||||
|
"deps": data["depends_build"],
|
||||||
|
"exclude": data["exclude"]
|
||||||
|
}
|
||||||
)
|
)
|
||||||
# Convert list of deps into dict(dir, name, deps)
|
# Convert list of deps into dict(dir, name, deps)
|
||||||
items = []
|
items = []
|
||||||
@@ -153,6 +158,7 @@ def print_modules(modules: List[Dict[str, Any]]) -> None:
|
|||||||
for dep in module["deps"]:
|
for dep in module["deps"]:
|
||||||
print(dep["name"], end=", ")
|
print(dep["name"], end=", ")
|
||||||
print()
|
print()
|
||||||
|
print(" excl:", module["exclude"])
|
||||||
|
|
||||||
|
|
||||||
def print_dependency_tree(tree: Dict[str, Any], lvl: int = 0) -> None:
|
def print_dependency_tree(tree: Dict[str, Any], lvl: int = 0) -> None:
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""Validate defined modules."""
|
|
||||||
print("Not yet implemented *///*")
|
|
||||||
print()
|
|
||||||
print("Run modules-generate.py instead, as it also kind of validates.")
|
|
||||||
282
bin/tools-generate.py
Executable file
282
bin/tools-generate.py
Executable file
@@ -0,0 +1,282 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""Generate Ansible group_vars from tools (installed software) definition."""
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from collections import OrderedDict
|
||||||
|
from typing import Dict, List, Any
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
# GLOBALS
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
SCRIPT_PATH = str(os.path.dirname(os.path.realpath(__file__)))
|
||||||
|
REPOSITORY_PATH = str(os.path.dirname(SCRIPT_PATH))
|
||||||
|
PHP_TOOL_PATH = str(os.path.join(REPOSITORY_PATH, "php_tools"))
|
||||||
|
GROUP_VARS_PATH = str(os.path.join(REPOSITORY_PATH, ".ansible", "group_vars", "all"))
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
# HELPER FUNCTIONS
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def get_el_by_name(items: List[Dict[str, Any]], name: str) -> Dict[str, Any]:
|
||||||
|
"""Returns an element from a dict list by its 'name' key with given value."""
|
||||||
|
for item in items:
|
||||||
|
if item["name"] == name:
|
||||||
|
return item
|
||||||
|
print("error, key name not found by value", name, "in list: ", items)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def load_yaml(path: str) -> Dict[str, Any]:
|
||||||
|
"""Load yaml file and return its dict()."""
|
||||||
|
with open(path, "r", encoding="utf8") as fp:
|
||||||
|
data = yaml.safe_load(fp)
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
def load_yaml_raw(path: str, indent: int = 0) -> str:
|
||||||
|
"""Load and returns yaml file as str."""
|
||||||
|
lines = []
|
||||||
|
with open(path, "r", encoding="utf8") as fp:
|
||||||
|
for line in fp:
|
||||||
|
# Remove: empty lines and ---
|
||||||
|
if line in ("---\n", "---\r\n", "\n", "\r\n"):
|
||||||
|
continue
|
||||||
|
# Remove: comments
|
||||||
|
if line.startswith("#"):
|
||||||
|
continue
|
||||||
|
lines.append(" " * indent + line)
|
||||||
|
return "".join(lines)
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
# TOOL FUNCTIONS
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def get_tool_options(tool_dirname: str) -> Dict[str, Any]:
|
||||||
|
"""Returns yaml dict options of a PHP tool given by its absolute file path."""
|
||||||
|
return load_yaml(os.path.join(PHP_TOOL_PATH, tool_dirname, "options.yml"))
|
||||||
|
|
||||||
|
|
||||||
|
def get_tool_build(tool_dirname: str) -> Dict[str, Any]:
|
||||||
|
"""Returns yaml dict build configuration of a PHP tool given by its absolute file path."""
|
||||||
|
return load_yaml(os.path.join(PHP_TOOL_PATH, tool_dirname, "install.yml"))
|
||||||
|
|
||||||
|
|
||||||
|
def get_tools(selected_tools: List[str], ignore_dependencies: bool) -> List[Dict[str, Any]]:
|
||||||
|
"""Returns a list of PHP tool directory names.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
selected_tools: If not empty, only gather specified tools (and its dependencies).
|
||||||
|
ignore_dependencies: If true, all dependent tools will be ignored.
|
||||||
|
"""
|
||||||
|
tools = []
|
||||||
|
with os.scandir(PHP_TOOL_PATH) as it:
|
||||||
|
for item in it:
|
||||||
|
if not item.name.startswith(".") and item.is_dir():
|
||||||
|
data = get_tool_options(item.name)
|
||||||
|
tools.append(
|
||||||
|
{
|
||||||
|
"dir": item.name,
|
||||||
|
"name": data["name"],
|
||||||
|
"deps": data["depends"],
|
||||||
|
"exclude": data["exclude"]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
# Convert list of deps into dict(dir, name, deps)
|
||||||
|
items = []
|
||||||
|
for tool in tools:
|
||||||
|
if tool["deps"] and not ignore_dependencies:
|
||||||
|
deps = []
|
||||||
|
for dep in tool["deps"]:
|
||||||
|
deps.append(get_el_by_name(tools, dep))
|
||||||
|
tool["deps"] = deps
|
||||||
|
items.append(tool)
|
||||||
|
else:
|
||||||
|
tool["deps"] = []
|
||||||
|
items.append(tool)
|
||||||
|
# Check if we only want to read a single tool
|
||||||
|
if selected_tools:
|
||||||
|
return [get_el_by_name(items, tool_name) for tool_name in selected_tools]
|
||||||
|
return sorted(items, key=lambda item: item["dir"])
|
||||||
|
|
||||||
|
|
||||||
|
def get_tool_dependency_tree(tools: List[Dict[str, Any]]) -> OrderedDict[str, Any]:
|
||||||
|
"""Returns dictionary of tool dependency tree."""
|
||||||
|
tool_tree = OrderedDict() # type: OrderedDict[str, Any]
|
||||||
|
|
||||||
|
for tool in tools:
|
||||||
|
tool_name = tool["name"]
|
||||||
|
tool_deps = tool["deps"]
|
||||||
|
|
||||||
|
tool_tree[tool_name] = {}
|
||||||
|
|
||||||
|
# Do we have tool requirements?
|
||||||
|
if len(tool_deps) > 0:
|
||||||
|
tool_tree[tool_name] = get_tool_dependency_tree(tool_deps)
|
||||||
|
return tool_tree
|
||||||
|
|
||||||
|
|
||||||
|
def resolve_tool_dependency_tree(tree: OrderedDict[str, Any]) -> List[str]:
|
||||||
|
"""Returns sorted list of resolved dependencies."""
|
||||||
|
resolved = []
|
||||||
|
for key, _ in tree.items():
|
||||||
|
# Has dependenies
|
||||||
|
if tree[key]:
|
||||||
|
childs = resolve_tool_dependency_tree(tree[key])
|
||||||
|
for child in childs:
|
||||||
|
if child not in resolved:
|
||||||
|
resolved.append(child)
|
||||||
|
# Add current node, if not already available
|
||||||
|
if key not in resolved:
|
||||||
|
resolved.append(key)
|
||||||
|
return resolved
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
# PRINT FUNCTIONS
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def print_tools(tools: List[Dict[str, Any]]) -> None:
|
||||||
|
"""Print directory tools."""
|
||||||
|
for tool in tools:
|
||||||
|
print(tool["dir"] + "/")
|
||||||
|
print(" name:", tool["name"])
|
||||||
|
print(" deps:", end=" ")
|
||||||
|
for dep in tool["deps"]:
|
||||||
|
print(dep["name"], end=", ")
|
||||||
|
print()
|
||||||
|
print(" excl:", tool["exclude"])
|
||||||
|
|
||||||
|
|
||||||
|
def print_dependency_tree(tree: Dict[str, Any], lvl: int = 0) -> None:
|
||||||
|
"""Print dependency tree of tools."""
|
||||||
|
for key, value in tree.items():
|
||||||
|
print(" " * lvl, "-", key)
|
||||||
|
if value:
|
||||||
|
print_dependency_tree(tree[key], lvl + 2)
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
# WRITE ANSIBLE GROUP_VARS FUNCTIONS
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def write_group_vars(tools: List[str]) -> None:
|
||||||
|
"""Write work.yml group_vars for ansible."""
|
||||||
|
group_vars = os.path.join(GROUP_VARS_PATH, "work.yml")
|
||||||
|
|
||||||
|
with open(group_vars, "w", encoding="utf8") as fp:
|
||||||
|
fp.write("---\n\n")
|
||||||
|
fp.write("# DO NOT ALTER THIS FILE - IT IS AUTOGENERATED.\n\n")
|
||||||
|
|
||||||
|
# Enabled tools
|
||||||
|
fp.write("# The following specifies the order in which tools are being installed.\n")
|
||||||
|
fp.write("tools_enabled:\n")
|
||||||
|
for tool in tools:
|
||||||
|
fp.write(" - " + tool + "\n")
|
||||||
|
fp.write("\n\n")
|
||||||
|
|
||||||
|
# Build defines tools
|
||||||
|
fp.write("# The following specifies how tools are being installed.\n")
|
||||||
|
fp.write("tools_available:\n")
|
||||||
|
for tool in tools:
|
||||||
|
opts = get_tool_options(tool)
|
||||||
|
fp.write(" " + tool + ":\n")
|
||||||
|
fp.write(" disabled: [" + ", ".join(str(x) for x in opts["exclude"]) + "]\n")
|
||||||
|
fp.write(load_yaml_raw(os.path.join(PHP_TOOL_PATH, tool, "install.yml"), 4))
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
# MAIN FUNCTION
|
||||||
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
def print_help() -> None:
|
||||||
|
"""Show help screen."""
|
||||||
|
print("Usage:", os.path.basename(__file__), "[options] [PHP-EXT]...")
|
||||||
|
print(" ", os.path.basename(__file__), "-h, --help")
|
||||||
|
print()
|
||||||
|
print("This script will generate the Ansible group_vars file: .ansible/group_vars/all/work.yml")
|
||||||
|
print("based on all the tools found in php_tools/ directory.")
|
||||||
|
print()
|
||||||
|
print("Positional arguments:")
|
||||||
|
print(" [PHP-EXT] Specify None, one or more PHP tools to generate group_vars for.")
|
||||||
|
print(" When no PHP tool is specified (argument is omitted), group_vars")
|
||||||
|
print(" for all tools will be genrated.")
|
||||||
|
print(" When one or more PHP tool are specified, only group_vars for")
|
||||||
|
print(" these tools will be created.")
|
||||||
|
print(" only be generated for this single tool (and its dependencies).")
|
||||||
|
print(" This is useful if you want to test new tools and not build all")
|
||||||
|
print(" previous tools in the Dockerfile.")
|
||||||
|
print()
|
||||||
|
print(" Note: You still need to generate the Dockerfiles via Ansible for")
|
||||||
|
print(" the changes to take effect, before building the image.")
|
||||||
|
print("Optional arguments:")
|
||||||
|
print(" -i Ignore dependent tools.")
|
||||||
|
print(" By default each exentions is checked for build dependencies of other")
|
||||||
|
print(" tools. For example many tools build against libxml ext.")
|
||||||
|
print(" By specifying -i, those dependencies are not beeing added to")
|
||||||
|
print(" ansible group_vars. Use at your own risk.")
|
||||||
|
|
||||||
|
|
||||||
|
def main(argv: List[str]) -> None:
|
||||||
|
"""Main entrypoint."""
|
||||||
|
ignore_dependencies = False
|
||||||
|
selected_tools = []
|
||||||
|
if len(argv):
|
||||||
|
for arg in argv:
|
||||||
|
if arg in ("-h", "--help"):
|
||||||
|
print_help()
|
||||||
|
sys.exit(0)
|
||||||
|
for arg in argv:
|
||||||
|
if arg.startswith("-") and arg != "-i":
|
||||||
|
print("Invalid argument:", arg)
|
||||||
|
print("Use -h or --help for help")
|
||||||
|
sys.exit(1)
|
||||||
|
if arg == "-i":
|
||||||
|
ignore_dependencies = True
|
||||||
|
else:
|
||||||
|
selected_tools.append(arg)
|
||||||
|
|
||||||
|
# Get tools in order of dependencies
|
||||||
|
tools = get_tools(selected_tools, ignore_dependencies)
|
||||||
|
tool_tree = get_tool_dependency_tree(tools)
|
||||||
|
names = resolve_tool_dependency_tree(tool_tree)
|
||||||
|
|
||||||
|
print("#", "-" * 78)
|
||||||
|
print("# Paths")
|
||||||
|
print("#", "-" * 78)
|
||||||
|
print("Repository: ", REPOSITORY_PATH)
|
||||||
|
print("PHP Tools: ", PHP_TOOL_PATH)
|
||||||
|
print("Group Vars: ", GROUP_VARS_PATH)
|
||||||
|
print()
|
||||||
|
|
||||||
|
print("#", "-" * 78)
|
||||||
|
print("# Tool directories")
|
||||||
|
print("#", "-" * 78)
|
||||||
|
print_tools(tools)
|
||||||
|
print()
|
||||||
|
|
||||||
|
print("#", "-" * 78)
|
||||||
|
print("# Build Dependency Tree")
|
||||||
|
print("#", "-" * 78)
|
||||||
|
print_dependency_tree(tool_tree)
|
||||||
|
print()
|
||||||
|
|
||||||
|
print("#", "-" * 78)
|
||||||
|
print("# Build order")
|
||||||
|
print("#", "-" * 78)
|
||||||
|
print("\n".join(names))
|
||||||
|
|
||||||
|
# Create group_vars file work.yml
|
||||||
|
write_group_vars(names)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main(sys.argv[1:])
|
||||||
8
php_tools/angular_cli/README.md
Normal file
8
php_tools/angular_cli/README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Angular CLI
|
||||||
|
|
||||||
|
The CLI tool for Angular.
|
||||||
|
|
||||||
|
| Platform | Url |
|
||||||
|
|----------|------------------------------------------------------------------|
|
||||||
|
| NPM | https://www.npmjs.com/package/@angular/cli |
|
||||||
|
| GitHub | https://github.com/angular/angular-cli |
|
||||||
13
php_tools/angular_cli/install.yml
Normal file
13
php_tools/angular_cli/install.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
check: ng version 2>&1 | grep -iE 'Angular CLI:\s*[0-9][.0-9]+' || (ng version; false)
|
||||||
|
|
||||||
|
all:
|
||||||
|
type: npm
|
||||||
|
package: "@angular/cli"
|
||||||
|
binary: ng
|
||||||
|
version:
|
||||||
|
build_dep: []
|
||||||
|
run_dep: []
|
||||||
|
pre:
|
||||||
|
post:
|
||||||
11
php_tools/angular_cli/options.yml
Normal file
11
php_tools/angular_cli/options.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# The name of the module
|
||||||
|
name: angular_cli
|
||||||
|
|
||||||
|
# Exclude module build/installation for the following PHP versions
|
||||||
|
exclude: []
|
||||||
|
|
||||||
|
# In order for this tool to build/install correctly,
|
||||||
|
# the following tools must have been installed first.
|
||||||
|
depends: []
|
||||||
8
php_tools/asgardcms/README.md
Normal file
8
php_tools/asgardcms/README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# AsgardCms
|
||||||
|
|
||||||
|
AsgardCms application installer.
|
||||||
|
|
||||||
|
| Platform | Url |
|
||||||
|
|----------|------------------------------------------------------------------|
|
||||||
|
| Composer | https://packagist.org/packages/asgardcms/asgardcms-installer |
|
||||||
|
| GitHub | https://github.com/AsgardCms/asgardcms-installer |
|
||||||
15
php_tools/asgardcms/install.yml
Normal file
15
php_tools/asgardcms/install.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
check: asgardcms --version 2>/dev/null | grep -Ei 'AsgardCMS\sInstaller\s[0-9][.0-9]+' || (asgardcms --version; false)
|
||||||
|
|
||||||
|
all:
|
||||||
|
type: composer
|
||||||
|
composer: 2
|
||||||
|
package: asgardcms/asgardcms-installer
|
||||||
|
# https://github.com/AsgardCms/asgardcms-installer/issues/1
|
||||||
|
version: dev-master
|
||||||
|
binary: asgardcms
|
||||||
|
build_dep: []
|
||||||
|
run_dep: []
|
||||||
|
pre:
|
||||||
|
post:
|
||||||
11
php_tools/asgardcms/options.yml
Normal file
11
php_tools/asgardcms/options.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# The name of the module
|
||||||
|
name: asgardcms
|
||||||
|
|
||||||
|
# Exclude module build/installation for the following PHP versions
|
||||||
|
exclude: [5.2, 5.3, 5.4]
|
||||||
|
|
||||||
|
# In order for this tool to build/install correctly,
|
||||||
|
# the following tools must have been installed first.
|
||||||
|
depends: []
|
||||||
8
php_tools/codeception/README.md
Normal file
8
php_tools/codeception/README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Codeception
|
||||||
|
|
||||||
|
BDD-style testing framework.
|
||||||
|
|
||||||
|
| Platform | Url |
|
||||||
|
|----------|------------------------------------------------------------------|
|
||||||
|
| Composer | https://packagist.org/packages/codeception/codeception |
|
||||||
|
| GitHub | https://github.com/Codeception/Codeception |
|
||||||
14
php_tools/codeception/install.yml
Normal file
14
php_tools/codeception/install.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
check: codecept --version 2>/dev/null | grep -E '^Codeception(\sversion)?\s[0-9][.0-9]+$' || (codecept --version; false)
|
||||||
|
|
||||||
|
all:
|
||||||
|
type: composer
|
||||||
|
composer: 2
|
||||||
|
package: codeception/codeception
|
||||||
|
# version:
|
||||||
|
binary: codecept
|
||||||
|
build_dep: []
|
||||||
|
run_dep: []
|
||||||
|
# pre:
|
||||||
|
# post:
|
||||||
11
php_tools/codeception/options.yml
Normal file
11
php_tools/codeception/options.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# The name of the module
|
||||||
|
name: codeception
|
||||||
|
|
||||||
|
# Exclude module build/installation for the following PHP versions
|
||||||
|
exclude: [5.2, 5.3]
|
||||||
|
|
||||||
|
# In order for this tool to build/install correctly,
|
||||||
|
# the following tools must have been installed first.
|
||||||
|
depends: []
|
||||||
8
php_tools/eslint/README.md
Normal file
8
php_tools/eslint/README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# ESlint
|
||||||
|
|
||||||
|
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions.
|
||||||
|
|
||||||
|
| Platform | Url |
|
||||||
|
|----------|------------------------------------------------------------------|
|
||||||
|
| NPM | https://www.npmjs.com/package/eslint |
|
||||||
|
| GitHub | https://github.com/eslint/eslint |
|
||||||
13
php_tools/eslint/install.yml
Normal file
13
php_tools/eslint/install.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
check: eslint -v | grep -E '[0-9][.0-9]+' || (eslint -v; false)
|
||||||
|
|
||||||
|
all:
|
||||||
|
type: npm
|
||||||
|
package: "eslint"
|
||||||
|
binary: eslint
|
||||||
|
version:
|
||||||
|
build_dep: []
|
||||||
|
run_dep: []
|
||||||
|
pre:
|
||||||
|
post:
|
||||||
11
php_tools/eslint/options.yml
Normal file
11
php_tools/eslint/options.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# The name of the module
|
||||||
|
name: eslint
|
||||||
|
|
||||||
|
# Exclude module build/installation for the following PHP versions
|
||||||
|
exclude: []
|
||||||
|
|
||||||
|
# In order for this tool to build/install correctly,
|
||||||
|
# the following tools must have been installed first.
|
||||||
|
depends: []
|
||||||
7
php_tools/jq/README.md
Normal file
7
php_tools/jq/README.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# yq
|
||||||
|
|
||||||
|
jq is a lightweight and flexible command-line JSON processor.
|
||||||
|
|
||||||
|
| Platform | Url |
|
||||||
|
|----------|------------------------------------------------------------------|
|
||||||
|
| GitHub | https://github.com/stedolan/jq |
|
||||||
7
php_tools/jq/install.yml
Normal file
7
php_tools/jq/install.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
check: jq --version 2>&1 | grep -E '[0-9][.0-9]+' || (jq --version; false)
|
||||||
|
|
||||||
|
all:
|
||||||
|
type: apt
|
||||||
|
package: jq
|
||||||
11
php_tools/jq/options.yml
Normal file
11
php_tools/jq/options.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# The name of the module
|
||||||
|
name: jq
|
||||||
|
|
||||||
|
# Exclude module build/installation for the following PHP versions
|
||||||
|
exclude: []
|
||||||
|
|
||||||
|
# In order for this tool to build/install correctly,
|
||||||
|
# the following tools must have been installed first.
|
||||||
|
depends: []
|
||||||
10
php_tools/lumen/README.md
Normal file
10
php_tools/lumen/README.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Laravel Lumen installer
|
||||||
|
|
||||||
|
Lumen application installer.
|
||||||
|
|
||||||
|
**Note:** This package is abandoned and no longer maintained. No replacement package was suggested.
|
||||||
|
|
||||||
|
| Platform | Url |
|
||||||
|
|----------|------------------------------------------------------------------|
|
||||||
|
| Composer | https://packagist.org/packages/laravel/lumen-installer |
|
||||||
|
| GitHub | https://github.com/laravel/lumen-installer |
|
||||||
14
php_tools/lumen/install.yml
Normal file
14
php_tools/lumen/install.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
check: lumen --version 2>/dev/null | grep -E '^Lumen Installer\s[0-9][.0-9]+$' || (lumen --version; false)
|
||||||
|
|
||||||
|
all:
|
||||||
|
type: composer
|
||||||
|
composer: 2
|
||||||
|
package: laravel/lumen-installer
|
||||||
|
# version:
|
||||||
|
binary: lumen
|
||||||
|
build_dep: []
|
||||||
|
run_dep: []
|
||||||
|
# pre:
|
||||||
|
# post:
|
||||||
11
php_tools/lumen/options.yml
Normal file
11
php_tools/lumen/options.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# The name of the module
|
||||||
|
name: lumen
|
||||||
|
|
||||||
|
# Exclude module build/installation for the following PHP versions
|
||||||
|
exclude: [5.2, 5.3, 5.4]
|
||||||
|
|
||||||
|
# In order for this tool to build/install correctly,
|
||||||
|
# the following tools must have been installed first.
|
||||||
|
depends: []
|
||||||
9
php_tools/mdl/README.md
Normal file
9
php_tools/mdl/README.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# mdl
|
||||||
|
|
||||||
|
A tool to check markdown files and flag style issues.
|
||||||
|
|
||||||
|
| Platform | Url |
|
||||||
|
|----------|------------------------------------------------------------------|
|
||||||
|
| Gems | https://rubygems.org/gems/mdl |
|
||||||
|
| Ruby | https://www.ruby-toolbox.com/projects/mdl |
|
||||||
|
| GitHub | https://github.com/markdownlint/markdownlint |
|
||||||
60
php_tools/mdl/install.yml
Normal file
60
php_tools/mdl/install.yml
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
check: mdl --version | grep -E '[.0-9]+' || (mdl --version; false)
|
||||||
|
|
||||||
|
all:
|
||||||
|
type: rubygem
|
||||||
|
package: mdl
|
||||||
|
# version:
|
||||||
|
build_dep: [ruby-dev]
|
||||||
|
run_dep: [ruby]
|
||||||
|
# pre:
|
||||||
|
# post:
|
||||||
|
|
||||||
|
7.2:
|
||||||
|
type: rubygem
|
||||||
|
version: 0.11.0
|
||||||
|
pre: |
|
||||||
|
gem install chef-utils -v 16.6.14 \
|
||||||
|
|
||||||
|
7.1:
|
||||||
|
type: rubygem
|
||||||
|
version: 0.11.0
|
||||||
|
pre: |
|
||||||
|
gem install chef-utils -v 16.6.14 \
|
||||||
|
|
||||||
|
7.0:
|
||||||
|
type: rubygem
|
||||||
|
version: 0.5.0
|
||||||
|
pre: |
|
||||||
|
gem install mixlib-config -v 2.2.4 \
|
||||||
|
|
||||||
|
5.6:
|
||||||
|
type: rubygem
|
||||||
|
version: 0.5.0
|
||||||
|
pre: |
|
||||||
|
gem install mixlib-config -v 2.2.4 \
|
||||||
|
|
||||||
|
5.5:
|
||||||
|
type: rubygem
|
||||||
|
version: 0.5.0
|
||||||
|
pre: |
|
||||||
|
gem install mixlib-config -v 2.2.4 \
|
||||||
|
|
||||||
|
5.4:
|
||||||
|
type: rubygem
|
||||||
|
version: 0.5.0
|
||||||
|
pre: |
|
||||||
|
gem install mixlib-config -v 2.2.4 \
|
||||||
|
|
||||||
|
5.3:
|
||||||
|
type: rubygem
|
||||||
|
version: 0.5.0
|
||||||
|
pre: |
|
||||||
|
gem install mixlib-config -v 2.2.4 \
|
||||||
|
|
||||||
|
5.2:
|
||||||
|
type: rubygem
|
||||||
|
version: 0.5.0
|
||||||
|
pre: |
|
||||||
|
gem install mixlib-config -v 2.2.4 \
|
||||||
11
php_tools/mdl/options.yml
Normal file
11
php_tools/mdl/options.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# The name of the module
|
||||||
|
name: mdl
|
||||||
|
|
||||||
|
# Exclude module build/installation for the following PHP versions
|
||||||
|
exclude: []
|
||||||
|
|
||||||
|
# In order for this tool to build/install correctly,
|
||||||
|
# the following tools must have been installed first.
|
||||||
|
depends: []
|
||||||
10
php_tools/phpunit/README.md
Normal file
10
php_tools/phpunit/README.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# PHPUnit
|
||||||
|
|
||||||
|
PHPUnit is a programmer-oriented testing framework for PHP.
|
||||||
|
It is an instance of the xUnit architecture for unit testing frameworks.
|
||||||
|
|
||||||
|
| Platform | Url |
|
||||||
|
|----------|------------------------------------------------------------------|
|
||||||
|
| Website | https://phpunit.de/ |
|
||||||
|
| GitHub | https://github.com/sebastianbergmann/phpunit |
|
||||||
|
| Versions | https://phpunit.de/supported-versions.html |
|
||||||
39
php_tools/phpunit/install.yml
Normal file
39
php_tools/phpunit/install.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
check: phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false)
|
||||||
|
|
||||||
|
all:
|
||||||
|
type: custom
|
||||||
|
command: curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit
|
||||||
|
build_dep: []
|
||||||
|
run_dep: []
|
||||||
|
pre: PHP_UNIT_VERSION="9"
|
||||||
|
post: chmod +x /usr/local/bin/phpunit
|
||||||
|
|
||||||
|
7.2:
|
||||||
|
type: custom
|
||||||
|
pre: PHP_UNIT_VERSION="8"
|
||||||
|
|
||||||
|
7.1:
|
||||||
|
type: custom
|
||||||
|
pre: PHP_UNIT_VERSION="7"
|
||||||
|
|
||||||
|
7.0:
|
||||||
|
type: custom
|
||||||
|
pre: PHP_UNIT_VERSION="6"
|
||||||
|
|
||||||
|
5.6:
|
||||||
|
type: custom
|
||||||
|
pre: PHP_UNIT_VERSION="5"
|
||||||
|
|
||||||
|
5.5:
|
||||||
|
type: custom
|
||||||
|
pre: PHP_UNIT_VERSION="4"
|
||||||
|
|
||||||
|
5.4:
|
||||||
|
type: custom
|
||||||
|
pre: PHP_UNIT_VERSION="4"
|
||||||
|
|
||||||
|
5.3:
|
||||||
|
type: custom
|
||||||
|
pre: PHP_UNIT_VERSION="4"
|
||||||
11
php_tools/phpunit/options.yml
Normal file
11
php_tools/phpunit/options.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# The name of the module
|
||||||
|
name: phpunit
|
||||||
|
|
||||||
|
# Exclude module build/installation for the following PHP versions
|
||||||
|
exclude: [5.2]
|
||||||
|
|
||||||
|
# In order for this tool to build/install correctly,
|
||||||
|
# the following tools must have been installed first.
|
||||||
|
depends: []
|
||||||
10
php_tools/prestissimo/README.md
Normal file
10
php_tools/prestissimo/README.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Prestissimo
|
||||||
|
|
||||||
|
Composer parallel install plugin for Composer 1.x.
|
||||||
|
|
||||||
|
**Note:** This package is abandoned and no longer maintained. No replacement package was suggested.
|
||||||
|
|
||||||
|
| Platform | Url |
|
||||||
|
|----------|------------------------------------------------------------------|
|
||||||
|
| Composer | https://packagist.org/packages/hirak/prestissimo |
|
||||||
|
| GitHub | https://github.com/hirak/prestissimo |
|
||||||
14
php_tools/prestissimo/install.yml
Normal file
14
php_tools/prestissimo/install.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# check:
|
||||||
|
|
||||||
|
all:
|
||||||
|
type: composer
|
||||||
|
composer: 1
|
||||||
|
package: hirak/prestissimo
|
||||||
|
# version:
|
||||||
|
# binary:
|
||||||
|
build_dep: []
|
||||||
|
run_dep: []
|
||||||
|
# pre:
|
||||||
|
# post:
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user