Redis is an open source NoSQL database written in ANSI C language, supports network, can be memory-based and persistent, log-type, Key-Value, and provides multiple languages. API.
You can view other versions of Redis through Sort by. The default is the latest version redis:latest.
You can also find other versions you want in the drop-down list:
In addition, we can Use the docker search redis command to view the available 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] ...
Here we pull the official latest version of the image:
$ docker pull redis:latest
Use the following command to check whether redis has been installed:
$ docker images
In the picture above You can see that we have installed the latest version of the redis image.
After the installation is complete, we can use the following command to run the redis container:
$ docker run -itd --name redis-test -p 6379:6379 redis
Parameter description:
-p 6379:6379: Map the 6379 port of the container service to the 6379 port of the host. The Redis service can be accessed from the outside directly through the host IP:6379.
Finally we can view the running information of the container through the docker ps command:
Then we test the use of the redis service through the redis-cli connection.
$ docker exec -it redis-test /bin/bash
The above is the detailed content of How to install Redis with Docker. For more information, please follow other related articles on the PHP Chinese website!