Docker image repository Install Redis on Docker1. Find the Redis image
2. Download the Redis image
docker images 3. Create a Redis configuration file
## Create directory mkdir -p /mydata/redis/conf ## Create the file touch /mydata/redis/conf/redis.conf 4. Create and start a Redis container
docker run \ -d \ --name redis \ -p 6379:6379 \ --restart unless-stopped \ -v /mydata/redis/data:/data \ -v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf \ redis-server /etc/redis/redis.conf \ redis:buster
5. Check whether Redis is running### View the running Docker container docker ps docker ps | grep redis 6. Enter the Redis container### Enter the Redis container through the Docker command docker exec -it redis /bin/bash docker exec -it redis bash ### Enter the Redis console redis-cli ### Add a variable with key name and value bella> set name bella ### View the value of the key name> get name ### Or you can directly enter the Redis console through the Docker Redis command (a combination of the above two commands) docker exec -it redis redis-cli > Separate commands > Merge Command 7. Exit the containerexit 8. Modify the Redis configuration file
9. Enter the Redis console with a password
## Enter the Redis container docker exec -it redis /bin/bash ## Enter the Redis console with the password redis-cli -h 127.0.0.1 -p 6379 -a 123456 This is the end of this article about the implementation steps of installing Redis container with Docker. For more relevant content about installing Redis with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Study on using characters instead of pictures to achieve rounded or sharp corners
>>: Problems with join queries and subqueries in MySQL
Table of contents background Function Purpose Ide...
Preface I'm currently working on the data ana...
Table of contents 1: Encapsulation idea 2. Packag...
introduction You must have encountered this in an...
1. Environment: CentOS7, Openssl1.1.1k. 2. Concep...
1. Problem Description For security reasons, the ...
HTML reuse is a term that is rarely mentioned. Tod...
Let’s start the discussion from a common question...
I have introduced it to you before: docker (deplo...
First: Installation of MySQL Download the MySQL s...
Vue uses Ref to get component instances across le...
This article shares with you how to install the M...
Brief description Suitable for readers: Mobile de...
Where is my hometown when I look northwest? How m...
Today, my colleague encountered a very strange pr...