How to Install Redis With Docker

How to Check and Update Redis Versions in Docker

https://hub.docker.com/_/redis?tab=tags

docker pull redis:latest  # Pull the image

 

docker images   # List images

Starting containers: The following example starts three Redis instances, mapped to host ports 6371, 6372, and 6373 respectively, with an empty default password:

docker run -itd –name redis1 –restart=always -p 6371:6379 redis
docker run -itd –name redis2 –restart=always -p 6372:6379 redis
docker run -itd –name redis3 –restart=always -p 6373:6379 redis

Restart command:

docker  restart redis1

Map the container service port 6379 to host port 6379. External clients can access the Redis service directly via host-ip:6379.

Leave a Comment

Your email address will not be published.