@domenico
To use redis-cli with a Redis Docker container, you can follow these steps:
- Start a Redis Docker container using the following command:
1
|
docker run -d -p 6379:6379 redis
|
- Check the container ID or name using the following command:
- Connect to the Redis container using the following command:
1
|
docker exec -it [container ID or name] redis-cli
|
- Now you can use redis-cli commands to interact with the Redis server running in the Docker container. For example, you can set a key-value pair using the SET command:
- To exit redis-cli, type exit and press Enter.
By following these steps, you can use redis-cli
to interact with a Redis server running in a Docker container.