Redis mounted on CentOS manner by Docker

Redis mounted on CentOS manner by Docker

First, ensure that installed docker.

Drag redis Mirror

docker pull redis

Here Insert Picture Description

Start redis

docker run -p 6379:6379 -v $PWD/data:/data  -d redis redis-server --appendonly yes

Here Insert Picture Description
Command Description:

  • -p 6379: 6379: 6379 to map the container port to the host port 6379
  • $ the PWD -v / data: / data : The data in the current directory is mounted to the main container / data
  • redis-server --appendonly yes: Start command in container execution redis-server, and open the redis persistence configuration

success! ! !

Guess you like

Origin www.cnblogs.com/wjw1014/p/12149552.html