类似的东西(Unable to connect to MYSQL from Docker Instance,redis connect timeout to remote server in a docker和Calling redis-cli in docker-compose setup)我试图在Docker上运行Redis。
我这样启动 Docker服务:docker run --name some-redis -d redis
输出:
docker run --name some-redis -d redis
d2ea8a77ba543b3e85020de6bc450e0d50ce9f60e0307e52fd4ae394bd29722
我使用
重新验证docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d2ea8a77ba54 redis "docker-entrypoint.sh" 6 minutes ago Up 6 minutes 6379/tcp some-redis
1be4f5dde2fb mysql/mysql-server:latest "/entrypoint.sh mysql" About an hour ago Up About an hour (healthy) 0.0.0.0:3306->3306/tcp, 33060/tcp mysql
e7d9e3713f5c ubuntu "/bin/bash" 6 days ago Up 6 days angry_hodgkin
当我执行以下命令时,它不起作用
docker exec -it redis redis-cli
Error response from daemon: No such container: redis
答案 0 :(得分:2)
您将容器命名为(\b(?:19\d{2}|20[0-4]\d|2050)\b)
,并尝试使用名称(?!.*(?1))
进行连接。
尝试regex101