1、拉取Redis镜像:
docker pull redis:6.0.6
2、执行挂载命令:
docker run -d --name=redis --restart=always --privileged=true -p 6379:6379 -v /usr/local/docker/redis/conf:/etc/redis/redis.conf -v /usr/local/docker/redis/data:/data redis:6.0.6
3、访问Redis容器:
docker exec -it redis bash
4、访问容器Redis客户端:
redis-cli
5、退出客户端和退出容器:
exit
exit
6、防火墙开放端口:
firewall-cmd --zone=public --add-port=6379/tcp --permanent systemctl restart firewalld