Description
Name and Version
bitnami/wordpress and bitnami/wordpress-nginx
What is the problem this feature will solve?
I would like to add support for the PHP Redis extension (php-redis) to the Bitnami WordPress and WordPress-NGINX containers. Right now, one way to do this would be to compile it manually in each Dockerfile, but that would add a lot of extra code to each Dockerfile, which seems inefficient.
What is the feature you are proposing to solve the problem?
Would it be possible to:
Ship php-redis along with the Bitnami PHP component (perhaps disabled by default)?
or
Compile it centrally for the relevant PHP version and make it downloadable as a separate component (via stacksmith)?
This has already been requested in issue #16124, and having php-redis available would help many plugins, such as W3 Total Cache.
Here’s an example of how I would integrate it via Dockerfile:
FROM docker.io/bitnami/minideb:bookworm AS builder
ARG DOWNLOADS_URL="downloads.bitnami.com/files/stacksmith"
ARG TARGETARCH
ENV HOME="/" \
OS_ARCH="${TARGETARCH:-amd64}" \
OS_FLAVOUR="debian-12" \
OS_NAME="linux"
SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"]
RUN install_packages autoconf build-essential curl ca-certificates
RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; mkdir /opt/bitnami ; \
COMPONENTS=( \
"php-8.2.27-11-linux-${OS_ARCH}-debian-12" \
) ; \
for COMPONENT in "${COMPONENTS[@]}"; do \
if [ ! -f "${COMPONENT}.tar.gz" ]; then \
curl -SsLf "https://${DOWNLOADS_URL}/${COMPONENT}.tar.gz" -O ; \
curl -SsLf "https://${DOWNLOADS_URL}/${COMPONENT}.tar.gz.sha256" -O ; \
fi ; \
sha256sum -c "${COMPONENT}.tar.gz.sha256" ; \
tar -zxf "${COMPONENT}.tar.gz" -C /opt/bitnami --strip-components=2 --no-same-owner --wildcards '*/files' ; \
rm -rf "${COMPONENT}".tar.gz{,.sha256} ; \
done
RUN cd / ; \
curl -SsLf https://pecl.php.net/get/redis-6.1.0.tgz | tar xzf - ; mv redis-* redis ; cd redis ; \
/opt/bitnami/php/bin/phpize ; \
./configure --with-php-config=/opt/bitnami/php/bin/php-config ; \
make
[...]
And finally in the the actual container:
COPY --from=builder /redis/modules/redis.so /opt/bitnami/php/lib/php/extensions/
RUN echo "extension=redis.so" >> /opt/bitnami/php/etc/php.ini
I am happy to contribute the implementation, but I need guidance on the best approach.
What alternatives have you considered?
No response