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 1. Create a vue-cli default pro...
Table of contents Preface Rolling principle accom...
I would like to share the installation and config...
Table of contents Preface text 1. Install styleli...
Many times we want the server to run a script reg...
Table of contents 1. Use scripts to encrypt TLS f...
Table of contents Easy to use Create a project vu...
We deal with Linux servers every day, especially ...
The best thing you can do for your data and compu...
In web design, we often use arrows as decoration ...
1. Check sql_mode select @@sql_mode The queried v...
Table of contents Preface Why do we need to encap...
Now .net core is cross-platform, and everyone is ...
To improve the performance of web pages, many dev...
Copy data When copying data remotely, we usually ...