redis-cli with TLS

Abstract

Build your own Docker image with BUILT_TLS=yes env variable. I don’t know why there’s no redis image with this flag on…

FROM amazonlinux
 
RUN yum install gcc gzip jemalloc-devel make openssl-devel tar tcl tcl-devel clang wget -y
RUN wget http://download.redis.io/redis-stable.tar.gz
RUN tar xvzf redis-stable.tar.gz
WORKDIR redis-stable
RUN CC=clang make BUILD_TLS=yes
ENV PATH "$PATH:src"
docker build -t my-redis .
docker run -it --rm --network host my-redis redis-cli -h localhost -p 6379 --username user --askpass --tls

References