Skip to content

Instantly share code, notes, and snippets.

@mingalevme
Created March 1, 2020 11:46
Show Gist options
  • Save mingalevme/c47c53e487729400aa3ccb7b1ef8adea to your computer and use it in GitHub Desktop.
Save mingalevme/c47c53e487729400aa3ccb7b1ef8adea to your computer and use it in GitHub Desktop.
Installing PHP Redis extension inside PHP-Alpine-based Docker container
NPROC=$(getconf _NPROCESSORS_ONLN)
mkdir -p /usr/src/php/ext
cd /usr/src/php/ext
pecl bundle redis
docker-php-ext-configure redis --enable-redis-igbinary --enable-redis-lzf
docker-php-ext-install -j${NPROC} redis
cd -
apk --no-cache add pcre-dev ${PHPIZE_DEPS} \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& apk del pcre-dev ${PHPIZE_DEPS} \
&& rm -rf /tmp/pear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment