Redis is an open source NoSQL database written in ANSI C language, supports network, can be memory-based and persistent, Key-Value NoSQL database, and provides API in multiple languages. Access Redis Mirror Library address: https://hub.docker.com/_/redis?tab=tags . You can view other versions of Redis through Sort by. The default is the latest version. redis:latest . ` <../wp-content/uploads/2016/06/docker-redis1.png>` __ You can also find other versions you want in the drop-down list: ` <../wp-content/uploads/2016/06/docker-redis2.png>` __ In addition, we can use the docker search redis command to view the available versions: Here we pull the official image of the latest version: ` <../wp-content/uploads/2016/06/docker-redis3.png>` __ Use the following command to see if redis is installed: ` <../wp-content/uploads/2016/06/docker-redis4.png>` __ You can see in the figure above that we have installed the latest version (latest) of the redis image. After the installation is complete, we can run the redis container using the following command: Parameter description: -p 6379:6379 Map port 6379 of CCS to port 6379 of host The service of Redis can be accessed directly from outside through the host ip:6379. ` <../wp-content/uploads/2016/06/docker-redis5.png>` __ Finally, we can pass through docker ps Command to view the running information of the container: ` <../wp-content/uploads/2016/06/docker-redis6.png>` __ Then we use the redis service through the redis-cli connection test. ` <../wp-content/uploads/2016/06/docker-redis7.png>` __ 2.26.1. 1. View the available Redis versions ¶
$ docker search redis
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
redis Redis is an open source ... 2321 [OK]
sameersbn/redis 32 [OK]
torusware/speedus-redis Always updated official ... 29 [OK]
bitnami/redis Bitnami Redis Docker Image 22 [OK]
anapsix/redis 11MB Redis server image ... 6 [OK]
webhippie/redis Docker images for redis 4 [OK]
clue/redis-benchmark A minimal docker image t... 3 [OK]
williamyeh/redis Redis image for Docker 3 [OK]
unblibraries/redis Leverages phusion/baseim... 2 [OK]
greytip/redis redis 3.0.3 1 [OK]
servivum/redis Redis Docker Image 1 [OK]
...
2.26.2. 2. Take the latest version of Redis image ¶
$ docker pull redis:latest
2.26.3. 3. View the local image ¶
$ docker images
2.26.4. 4. Run the container ¶
$ docker run -itd --name redis-test -p 6379:6379 redis
2.26.5. 5. Installation succeeded ¶
$ docker exec -it redis-test /bin/bash