Get the App
SLTechnology News&Howtos  ›  Servers  › 

Docker install redis

Shulou Source: shulou.com Published: 2022-06-02 20:51:34 09月22日 Update

1. Find Mirror

Docker search redis

two。 Pull the image

Docker pull redis

3. View local image

Docker images

4. Create redis configuration file directory and data directory

Mkdir data

Mkdir conf

5. Prepare the redis profile

Go to the official website to download redis.conf template

Http://download.redis.io/redis-stable/redis.conf

Modify the following parameters

# start with a daemon thread

Daemonize no

# set a password for redis

Requirepass password

# comment out this line to restrict redis to local access only

Bind 192.168.1.1

# redis persistence

Appendonly yes

Place the modified redis.conf in the conf directory

6. Start a redis instance (container)

Docker run-p 6379 privileged=true 6379-- name redis--privileged=true-v / usr/local/docker/redis/conf/redis.conf:/etc/redis/redis.conf-v / usr/local/docker/redis/data:/data-d redis redis-server / etc/redis/redis.conf

7. View container status

Docker ps-a

8. Test connection

Tags: Directories images containers files configurations lines parameters instances passwords data methods templates comments status threads preparation tests restrictions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL OPPO Reno Docker Microsoft Huawei