PrefaceThis tutorial demonstrates how to install the Redis image, create a Redis container, and map ports to mount data volumes and configuration data. environment
InstallPull the image docker pull redis View Mirror docker images Create and start the MySQL containerCreate data directories and configuration files Create a configuration folder mkdir -p /mydata/redis/conf Create a configuration file touch /mydata/redis/conf/redis.conf Reminder to avoid pitfalls Create the Create and start the MySQL container commandsudo docker run -p 6379:6379 --name redis \ -v /mydata/redis/data:/data \ -v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf \ -d redis redis-server /etc/redis/redis.conf Parameter Description
View running containersdocker ps Connecting to Redis in Dockerdocker exec -it redis redis-cli Store Value set name zhangsan
get name Setting up Redis persistent storageBy default, redis data is stored in memory. After restart, the data is lost. After setting persistent storage, the data will still be in memory after restart. echo "appendonly yes" >> /mydata/redis/conf/redis.conf This is the end of this article about the implementation steps of Docker installation and configuration of Redis image. For more relevant content about Docker installation of Redis image, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of HTML horizontal and vertical centering issues
>>: Introduction to JavaScript array deduplication and flattening functions
cause The reason for writing this blog is that I ...
Preface Golang provides the database/sql package ...
Pull the image root@EricZhou-MateBookProX: docker...
#docker search #docker pull portainer 1. Download...
Sometimes we may encounter such a requirement, th...
This article example shares the specific code of ...
1. Log in to VPN using IE browser 2. Remote login...
DTD is a set of grammatical rules for markup. It i...
Execute the command to install the plugin postcss...
Table of contents 1. Implement the component time...
<br />The content is reproduced from the Int...
The method of obtaining the position of the point...
Using the <img> element with the default sr...
To execute a shell command in Docker, you need to...
Preface This article mainly introduces the releva...