First prepare the redis.conf file,
Among them, redis.conf modify requirepass to be its own password
Then comment the line daemonize yes, otherwise it will be automatically closed after startup
Then start docker run -v /opt/server/redis/redis.conf:/usr/local/etc/redis/redis.conf --name myredis -p 6379:6379 -d redis redis-server /usr/local/etc /redis/redis.conf