Run Redis in Docker
File docker-compose.yml
version: "3.8"
services:
redis:
image: redis
volumes:
- ./data:/data
ports:
- 6379:6379
docker pull redis
docker-compose up
docker-compose up -d
docker container ls
telnet localhost 6379
How to connect to Redis server with redis-cli
?
You can run attach to docker container and use
redis-cli
directly.This command will attach you to the container's shell
Then you can use redis-cli just like it installed directly on the host system