当前位置:网站首页>Docker安装Redis镜像详细步骤(简单易懂,适合新手快速上手)
Docker安装Redis镜像详细步骤(简单易懂,适合新手快速上手)
2022-06-10 15:58:00 【杰肥啊】
文章目录
前言
需要看Docker安装MySQL小伙伴可以看这篇文章
Redis作为我们开发项目必备的一个存储中间件,学习如何Docker安装Redis是非常必要的,早期使用安装包安装实属太慢了,不能有一种即拿即用的感觉。
安装
1.访问Docker镜像仓库官网




2.找到对应的版本,复制右侧的命令即可
docker pull redis:6.2

3.查看镜像
等拉取好了镜像之后,docker images 查看一下镜像是否拉取成功。

4.启动Redis容器
4.1启动简单的容器
docker run --name myredis -p 6379:6379 -d redis:6.2
这样启动确实可以成功,但是有一个不好的地方就是我们没有把存储文件映射到外部,导致的现象就是如果我们重启容器或者删除了这个容器,里面的数据也都消失了。当然如果不考虑这个问题的话,该命令是一个不错的选择。
4.2启动完整的容器
docker run -p 6379:6379 -v /myredis/data:/data --name myredis -d redis:6.2
这样数据存储文件都会映射在宿主机,哪怕容器删除了,下次映射到该数据文件上,都会恢复。
5.查看运行的容器
使用docker ps 查看刚才的容器是否运行起来

6.连接RedisDesktopManager


边栏推荐
- The command set has reached strategic cooperation with Yingmin technology, and the domestic original Internet of things operating system has helped to make power detection "intelligent"
- 打造隐私计算领先方案 冲量在线数据互联平台获得鲲鹏Validated认证
- Full array of arrays
- Fiddler配置
- Four Byron poems translated from heartless sword
- Chinese translation of Rilke's autumn with heartless sword
- Fiddler set breakpoint
- postman常用断言
- STM32 printf garbled
- Devops-2- from the Phoenix Project
猜你喜欢

Diagram of the quarterly report of station B: the revenue is RMB 5.1 billion, with a year-on-year increase of 30% and nearly 300million monthly active users

Comply with medical reform and actively layout -- insight into the development of high-value medical consumables under the background of centralized purchase 2022

Rethinking atlas revolution for semantic image segmentation (deeplobv3) personal summary

Can deleted wechat friends be recovered? How to retrieve wechat friends after they are accidentally deleted

技术分享| 快对讲,全球对讲

接口测试学习笔记

Meetup回顾|DevOps&MLOps如何在企业中解决机器学习困境?

Can bus protocol Foundation

Research Report on development potential analysis and investment development strategy of global and Chinese hydraulic oil industry (2022-2028)

Take you to play completablefuture asynchronous programming
随机推荐
This paper introduces three feature selection methods in machine learning
PyTorch基础(一)-- Anaconda 和 PyTorch安装
Devops-1- introduction
2022 underground coal mine electrical examination question bank and online simulation examination
Have you ever written a line of efficient code that equals 20 lines of others?
Duyuan outdoor sprint to Shenzhen Stock Exchange: the annual revenue is 350million, and the color of Lin Xizhen family is obvious
亦舒作品经典语句
mysql数据库实现设置字段长度
Investment prospect and development strategy planning of China's waste power generation equipment industry 2022-2028 Edition
MySQL如何修改字段类型和字段长度
Customization development of defi cross chain mining DAPP system
Build a leading privacy computing scheme impulse online data interconnection platform and obtain Kunpeng validated certification
那年高考
Li Ling: in six years, how did I go from open source Xiaobai to Apache top project PMC
Pictographic dynamic graphic ideographic data
From web2 to Web3, ideology also needs to change
Introduction to postmangrpc function
Can deleted wechat friends be recovered? How to retrieve wechat friends after they are accidentally deleted
Technology sharing | quick intercom, global intercom
只有真正找到落地和实践元宇宙的正确方式,才能保证发展的行稳致远