docker pull redis
依次执行一下命令
mkdir -p /home/docker-work/redis/conf
mkdir -p /home/docker-work/redis/data
chmod 777 -R /home/docker-work/redis
1、配置文件可以根据这个文章创建
http://t.csdnimg.cn/3Y8fZ
2、创建后将文件放到上面的这个目录里/home/docker-work/redis/conf
docker run --name redis -p 6379:6379 \
-v /home/docker-work/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf \
-v /home/docker-work/redis/data:/data \
--restart=always \
--privileged=true \
-d redis redis-server /usr/local/etc/redis/redis.conf
docker ps
1、云服务器外网访问的话需要服务器开放6379端口
2、本机应用连redis查看容器ip命令
docker inspect redis