Skip to content

Instantly share code, notes, and snippets.

@lex64
Created April 11, 2024 06:38
Show Gist options
  • Save lex64/e96bf0e529fe267d7cbadc8b6c8abf72 to your computer and use it in GitHub Desktop.
Save lex64/e96bf0e529fe267d7cbadc8b6c8abf72 to your computer and use it in GitHub Desktop.
Install redis-cli on alpine linux
export REDIS_VERSION="7.2.4"
export REDIS_DOWNLOAD_URL="http://download.redis.io/releases/redis-${REDIS_VERSION}.tar.gz"
apk add --update --no-cache --virtual build-deps gcc make linux-headers musl-dev tar openssl-dev pkgconfig
wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"
mkdir -p /usr/src/redis
tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1
cd /usr/src/redis/src
make BUILD_TLS=yes MALLOC=libc redis-cli
cp redis-cli /usr/local/bin/
chmod +x /usr/local/bin/redis-cli
rm -r /usr/src/redis
apk del build-deps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment