1、查看可用的 Redis 版本##
$ docker search redis
[root@ecs ~]# docker search redis
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
redis Redis is an open source key-value store that… 11397 [OK]
bitnami/redis Bitnami Redis Docker Image 229 [OK]
bitnami/redis-sentinel Bitnami Docker Image for Redis Sentinel 39 [OK]
bitnami/redis-cluster 34
redis/redis-stack redis-stack installs a Redis server with add… 15
rapidfort/redis RapidFort optimized, hardened image for Redi… 15
rapidfort/redis-cluster RapidFort optimized, hardened image for Redi… 15
circleci/redis CircleCI images for Redis 14 [OK]
ubuntu/redis Redis, an open source key-value store. Long-… 11
redis/redis-stack-server redis-stack-server installs a Redis server w… 10
bitnami/redis-exporter 9
clearlinux/redis Redis key-value data structure server with t… 4
ibmcom/redis-ha 1
bitnami/redis-sentinel-exporter 1
ibmcom/ibm-cloud-databases-redis-operator Container image for the IBM Operator for Red… 1
rapidfort/redis6-ib RapidFort optimized, hardened image for Redi… 0
vmware/redis-photon 0
cimg/redis 0
ibmcom/redis-ppc64le 0
rancher/redislabs-ssl 0
drud/redis redis 0 [OK]
corpusops/redis https://github.com/corpusops/docker-images/ 0
blackflysolutions/redis Redis container for Drupal and CiviCRM 0
ibmcom/redisearch-ppc64le 0
greenbone/redis-server A redis service container image for the Gree… 0
2、取最新版的 Redis 镜像##
$ docker pull redis:latest
[root@ecs ~]# docker pull redis
Using default tag: latest
latest: Pulling from library/redis
6f28985ad184: Downloading [==================================================>] 27.1MB/27.1MB
60e8b46025d8: Download complete
122fe26e50b0: Downloading [==================================================>] 1.418MB/1.418MB
de3ca1eb2e20: Downloading [==================================================>] 10.1MB/10.1MB
4813a7e5bd57: Download complete
99dd8d3a66f2: Download complete
latest: Pulling from library/redis
31b3f1ad4ce1: Downloading [==================================================>] 31.4MB/31.4MB
ff29a33e56fb: Pulling fs layer
b230e0fd0bf5: Pulling fs layer
9469c4ab3de7: Downloading [==================================================>] 9.561MB/9.561MB
6bd1cefcc7a5: Waiting
610e362ffa50: Waiting
write /var/lib/docker/tmp/GetImageBlob2775371538: no space left on device
3、查看本地镜像 版本##
$ docker images
[root@ecs ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql 5.7 aa803eda0f25 7 days ago 433MB
hello-world latest feb5d9fea6a5 12 months ago 13.3kB
nginx latest 298ec0e28760 19 months ago 133MB
tomcat 7 50fcd208bfce 20 months ago 533MB
tomcat 8.5.38 02eaee4dc65c 3 years ago 463MB
primetoninc/jdk 1.6 2609e9765be8 4 years ago 539MB
tomcat 6 e53f2aec9cc9 5 years ago 355MB
grange74/centos6-java6-tomcat6 latest 481203b6b87d 7 years ago 347MB
4、运行容器##
$ docker run --restart=always --log-opt max-size=100m --log-opt max-file=2 -p 6379:6379 --name myredis -v /opt/myredis/redis.conf:/etc/redis/redis.conf -v /opt/myredis/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes --requirepass rootroot