Skip to content

Commit

Permalink
Run php-fpm with LD_PRELOAD for iconv lib #25
Browse files Browse the repository at this point in the history
  • Loading branch information
csandanov committed Apr 11, 2018
1 parent d3391ac commit 16743d6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
5 changes: 2 additions & 3 deletions 5.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ RUN set -xe; \
postgresql-dev \
yaml-dev; \
\
apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted; \
\
apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted; \
# Temporary install additional packages to keep client bins.
apk add --update --no-cache -t .bins-only \
postgresql \
Expand Down Expand Up @@ -288,4 +287,4 @@ COPY docker-entrypoint.sh /
COPY bin /usr/local/bin/

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["sudo", "-E", "php-fpm"]
CMD ["sudo", "-E", "LD_PRELOAD=/usr/lib/preloadable_libiconv.so", "php-fpm"]
1 change: 0 additions & 1 deletion 5.3/templates/zz-www.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ php_value[always_populate_raw_post_data] = {{ getenv "PHP_ALWAYS_POPULATE_RAW_PO
user = {{ getenv "PHP_FPM_USER" "www-data" }}
group = {{ getenv "PHP_FPM_GROUP" "www-data" }}

env[LD_PRELOAD] = {{ getenv "LD_PRELOAD" }}
{{ if getenv "PHP_FPM_ENV_VARS" }}{{ range jsonArray (getenv "PHP_FPM_ENV_VARS") }}{{ if getenv . }}
env[{{.}}] = {{ getenv . }}{{ end }}{{ end }}{{ end }}

Expand Down
5 changes: 2 additions & 3 deletions 5.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ RUN set -xe; \
rabbitmq-c-dev \
yaml-dev; \
\
apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted; \
\
apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted; \
# Install redis-cli.
apk add --update --no-cache redis; \
mkdir -p /tmp/pkgs-bins; \
Expand Down Expand Up @@ -315,4 +314,4 @@ COPY docker-entrypoint.sh /
COPY bin /usr/local/bin/

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["sudo", "-E", "php-fpm"]
CMD ["sudo", "-E", "LD_PRELOAD=/usr/lib/preloadable_libiconv.so", "php-fpm"]
1 change: 0 additions & 1 deletion 5.6/templates/zz-www.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ php_value[always_populate_raw_post_data] = {{ getenv "PHP_ALWAYS_POPULATE_RAW_PO
user = {{ getenv "PHP_FPM_USER" "www-data" }}
group = {{ getenv "PHP_FPM_GROUP" "www-data" }}

env[LD_PRELOAD] = {{ getenv "LD_PRELOAD" }}
{{ if getenv "PHP_FPM_ENV_VARS" }}{{ range jsonArray (getenv "PHP_FPM_ENV_VARS") }}{{ if getenv . }}
env[{{.}}] = {{ getenv . }}{{ end }}{{ end }}{{ end }}

Expand Down
6 changes: 3 additions & 3 deletions 7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ RUN set -xe; \
rabbitmq-c-dev \
yaml-dev; \
\
apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted; \
apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted;
\
# Install redis-cli.
apk add --update --no-cache redis; \
Expand Down Expand Up @@ -328,7 +328,7 @@ RUN set -xe; \
\
if [[ -z "${PHP_DEV}" ]]; then \
rm -rf /usr/src/php.tar.xz; \
fi;
fi

USER wodby

Expand All @@ -340,4 +340,4 @@ COPY docker-entrypoint.sh /
COPY bin /usr/local/bin/

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["sudo", "-E", "php-fpm"]
CMD ["sudo", "-E", "LD_PRELOAD=/usr/lib/preloadable_libiconv.so", "php-fpm"]
1 change: 0 additions & 1 deletion 7/templates/zz-www.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ php_value[output_buffering] = {{ getenv "PHP_OUTPUT_BUFFERING" "4096" }}
user = {{ getenv "PHP_FPM_USER" "www-data" }}
group = {{ getenv "PHP_FPM_GROUP" "www-data" }}

env[LD_PRELOAD] = {{ getenv "LD_PRELOAD" }}
{{ if getenv "PHP_FPM_ENV_VARS" }}{{ range jsonArray (getenv "PHP_FPM_ENV_VARS") }}{{ if getenv . }}
env[{{.}}] = {{ getenv . }}{{ end }}{{ end }}{{ end }}

Expand Down

0 comments on commit 16743d6

Please sign in to comment.