简体   繁体   English

如何从Mac的Redis Desktop Manager连接到Docker容器中的Redis服务器?

[英]How can I connect to Redis server in a Docker Container from Redis Desktop Manager in Mac?

I have configured a MacBook with Docker and docker-compose, my configuration in the docker-compose.yml for Redis is the following: 我已经使用Docker和docker-compose配置了MacBook,在Redis的docker-compose.yml中的配置如下:

redis: image: redis:3.0.6 container_name: cache

Redis is working, but I want to access to them with Redis Desktop Manager (or similar) from the host (The MacBook). Redis正在工作,但是我想使用Redis Desktop Manager(或类似产品)从主机(MacBook)访问它们。 The IP of my virtual machine is: 192.168.99.100 and I tried to configure with that IP and the 6379 port without success. 我的虚拟机的IP为: 192.168.99.100 ,我尝试使用该IP和6379端口进行配置,但未成功。 Anyone knows how can I have configure Redis Desktop Manager to access to the Redis server in my Docker Container? 谁知道我该如何配置Redis Desktop Manager以访问Docker容器中的Redis服务器?

Thanks in advance. 提前致谢。

You need to expose the port 6379 on your docker-machine add this to your docker-compose.yml 您需要在docker-machine上公开端口6379并将其添加到docker-compose.yml

redis:
  image: redis:3.0.6
  container_name: cache
  ports:
   -6379:6379

You should be able to access it then on (docker-machine ip (Your machine id)):6379 然后您应该可以在(docker-machine ip(您的机器ID))上访问它:6379

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM