docker版本redis安装

docker仓库查找redis镜像

  • 1.命令docker search redis,然后找到一个排名第一的,也是官方版本,就选它了
root@****:~# docker search redis
NAME                              DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
redis                             Redis is an open source key-value store th...   6738      [OK]       
bitnami/redis                     Bitnami Redis Docker Image                      110                  [OK]
sameersbn/redis                                                                   76                   [OK]
grokzen/redis-cluster             Redis cluster 3.0, 3.2, 4.0 & 5.0               44                   
hypriot/rpi-redis                 Raspberry Pi compatible redis image             34                   
kubeguide/redis-master            redis-master with "Hello World!"                28                   
rediscommander/redis-commander    Alpine image for redis-commander - Redis m...   22                   [OK]
kubeguide/guestbook-redis-slave   Guestbook redis slave                           22                   

  • 2.拉取最新redis镜像
docker pull redis 
  • 3.执行run命令启动redis
docker run -d -p 6379:6379 --name myRedis redis:latest
  • 4.进入redis-cli界面测试
root@iZbp1ik0m7ifdchj4p75rmZ:~# docker exec -it myRedis  redis-cli
127.0.0.1:6379> get x
(nil)
127.0.0.1:6379> get ssm
(nil)
127.0.0.1:6379> select 0
OK
127.0.0.1:6379> 

你可能感兴趣的:(docker版本redis安装)