Docker Install Redis

Docker Install Redis

Redis is an open source, ANSI C, network-enabled, in-memory persistent, Key-Value, NoSQL database with APIs in multiple languages.

1. Check the available Redis versions

Visit the Redis mirror repository at https://hub.docker.com/_/redis?tab=tags.

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

Docker Install Redis

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

Docker Install Redis

In addition, we can use the docker search redis command to see 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]
...

2. fetch the latest version of the Redis image

Here we pull the official latest version of the image:

$ docker pull redis:latest

Docker Install Redis

3. Check the local image

Use the following command to see if redis is installed:

$ docker images

Docker Install Redis

In the above image you can see that we have installed the latest version (latest) of the redis image.

4. Running the container

Once the installation is complete, we can run the redis container using the following command.

$ docker run -itd --name redis-test -p 6379:6379 redis

Parameter description.

  • -p 6379:6379: Maps port 6379 of the container service to port 6379 of the host. External access to the Redis service is possible directly through the host ip:6379.

Docker Install Redis

5. Successful installation

Finally, we can view the running information of the container by using the docker ps command.

Docker Install Redis

Next, we test using the redis service via the redis-cli connection.

$ docker exec -it redis-test /bin/bash

Docker Install Redis

Like(0)