当前位置:网站首页>Docker quickly installs & builds Redis environment
Docker quickly installs & builds Redis environment
2022-08-06 06:10:00 【CodeLearning Xiao】
Docker Quickly Install & Build Redis Environment
1. Download the Redis image
First pull the Redis image, here I choose the redis:alpine lightweight image version:
docker pull redis:alpine
After the download is complete, use docker images to confirm whether the image has been downloaded locally:
Check if the redis image is downloaded successfully
Second, run the Redis container
docker run
-p 6379:6379
--name redis
-v /usr/local/docker/redis/redis.conf:/etc/redis/redis.conf
-v/usr/local/docker/redis/data:/data
-d redis:alpine
redis-server /etc/redis/redis.conf --appendonly yes --requirepass “mypassword”
Command description:
-p 6379:6379: Map port 6379 of the container to port 6379 of the host;
-v /usr/local/docker/redis/data:/data : Store the /data data directory in the container, mount it to the /usr/local/docker/redis/data directory of the host;
-v /usr/local/docker/redis/redis.conf:/etc/redis/redis.conf : put the container/etc/redis/redis.conf configuration file, mounted on the host's /usr/local/docker/redis/redis.conf file;
redis-server --appendonly yes --requirepass “mypassword”: inThe container executes the redis-server startup command, opens the redis persistent configuration, and sets the password;
After the command is completed, check whether the container is successfully started:
Check if docker redis starts successfully
You can see that the redis container has been started successfully!
Third, connect the container just created
Execute the following command to connect to redis:
docker run -it redis:alpine redis-cli -h 172.17.0.1
边栏推荐
猜你喜欢
随机推荐
4.3 木马隐藏分析
Fortinet :《2021 年OT与网络安全现状报告》之「OT安全洞察」
pip管理软件命令
[C语言] 自制的贪吃蛇游戏
scala基础入门
Red hat修改静态路由
PCIe 5.1 - Introduction
践行企业社会责任 Fortinet首次发布《可持续发展报告》
Markdown中实现折叠代码块
动态规划之解码方法
3.6 Meterpreter 键盘记录
离线安装pip报错-gbk‘ codec can‘t encode character解决方法
微信公众号开发流程指南
openstack的neutron日志阅读
正则表达式去除空行,在每行文本后添加,
shell脚本编写(3.修改文件内容)
普通工厂类和抽象工厂类的区别
SSH service details
5.6 XSS跨站脚本攻击
win10任务栏图标居中
![[lua] 用lua实现扑克游戏发牌的逻辑代码](/img/0e/72a8f9df13e263ddd11a1f626e352b.png)








