Docker create redis container

1. Pull redis mirror:

docker pull redis

2. Create a container:

docker run -d --restart=always -v /data:/data --name myredis -p 36379:6379 redis --requirepass "123456"
  • -d the background
  • --retsart = always automatically restart
  • -v / data: / data host / data directory is mounted to the container / data directory
  • --name container name to myredis
  • -p port number mapping
  • --requirepass " 123456 " password 123456

3. Download redis Desktop Visualization Tool Connection Test: https://redisdesktop.com/

Connection success page:

 

Guess you like

Origin www.cnblogs.com/yanghe123/p/10960535.html