1.输入:docker ps
2.显示:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5d6687e29390 nmg-khpg "/bin/sh -c 'java -D…" 23 hours ago Up 23 hours 0.0.0.0:8084->8084/tcp nmg-khpg
34d0c5772a40 party-mini "/bin/sh -c 'java -D…" 28 hours ago Up 28 hours 0.0.0.0:8080->8080/tcp party-mini
d8dd9e4d7543 hainan-rwdc "/bin/sh -c 'java -D…" 28 hours ago Up 28 hours 0.0.0.0:8083->8083/tcp hainan-rwdc
04a5fe0ba3e1 city-sign "/bin/sh -c 'java -D…" 47 hours ago Up 47 hours 0.0.0.0:8086->8086/tcp city-sign
0cd6d0460ab7 city-khpg "/bin/sh -c 'java -D…" 5 weeks ago Up 5 weeks 0.0.0.0:8085->8085/tcp city-khpg
fc8f03fc931e gds-zlys "/bin/sh -c 'java -D…" 2 months ago Up 2 months 0.0.0.0:8082->8082/tcp gds-zlys
fda2f837cf5d gds-szdh "/bin/sh -c 'java -D…" 3 months ago Up 3 months 0.0.0.0:8081->8081/tcp gds-szdh
115d49110511 minio/minio "/usr/bin/docker-ent…" 3 months ago Up 3 months 0.0.0.0:9000->9000/tcp gds-minio
63bce71d7df2 redis:5.0.7 "docker-entrypoint.s…" 3 months ago Up 3 months 0.0.0.0:6379->6379/tcp gds-redis
3.进入当前redis服务配置:docker exec -it 63bce bash
或
进入redis容器,并运行redis-cli
docker exec -it redis容器名字 /bin/bash
4.输入/data# redis-cli
或
进入Redis容器内部
docker exec -it myredis redis-cli
5.设置密码
CONFIG SET requirepass secret_password
或
CONFIG SET requirepass ""
# 通过将密码设为空字符来清空密码
# 将密码设置为 secret_password
QUIT
# 退出再连接,让新密码对客户端生效
6.清空密码
查看有无权限,无权限则证明有密码
keys *
7.输入密码
auth gov20130528
8.重新查看有权限
keys *
9.正式应用:查看docker中的内蒙古考核评估环境变量
docker inspect 5d6687