Home > Database > Redis > body text

How to install Redis with Docker

PHPz
Release: 2023-05-31 12:34:18
forward
1165 people have browsed it

Docker Install Redis

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.

1. View available Redis versions

You can view other versions of Redis through Sort by. The default is the latest version redis:latest.

How to install Redis with Docker

You can also find other versions you want in the drop-down list:

How to install Redis with Docker

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]
...
Copy after login

2. Get the latest version of the Redis image

Here we pull the official latest version of the image:

$ docker pull redis:latest
Copy after login

How to install Redis with Docker

3. Check the local image

Use the following command to check whether redis has been installed:

$ docker images
Copy after login

How to install Redis with Docker

In the picture above You can see that we have installed the latest version of the redis image.

4. Run the container

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
Copy after login

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.

How to install Redis with Docker

5. Installation successful

Finally we can view the running information of the container through the docker ps command:

How to install Redis with Docker

Then we test the use of the redis service through the redis-cli connection.

$ docker exec -it redis-test /bin/bash
Copy after login

How to install Redis with Docker

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!