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

How to quickly deploy Redis with Docker

王林
Release: 2023-05-27 08:07:56
forward
803 people have browsed it

1 Find the redis image on Docker Hub

[root@wugenqiang redis]# docker search  redis
Copy after login

2 pull the image

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

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

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

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!

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