Home >Database >Redis >How to quickly deploy Redis with Docker

How to quickly deploy Redis with Docker

王林
王林forward
2023-05-27 08:07:56810browse

1 Find the redis image on Docker Hub

[root@wugenqiang redis]# docker search  redis

2 pull the image

[root@wugenqiang ~]# docker pull redis:3.2

Here we pull the official image, labeled 3.2

3 Run the image

[root@wugenqiang redis]# docker run -d --name redis-server -p 6379:6379 -v $PWD/data:/data  -d redis:3.2 --requirepass "123456" --appendonly yes

How to quickly deploy Redis with Docker

Command description:

-p 6379:6379: Map the 6379 port of the container to the 6379 port of the host

-v $PWD /data:/data: Mount the data in the current directory in the host to the container’s /data

My $PWD/data =

How to quickly deploy Redis with Docker

- -appendonly yes: Execute the startup command in the container and open the redis persistence configuration

4 Check the container startup status

[root@wugenqiang redis]# docker ps

How to quickly deploy Redis with Docker

The above is the detailed content of How to quickly deploy Redis with Docker. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete