使用mongodb罗盘GUI连接到docker内部的Mongodb
问题描述:
我在docker容器的默认端口27017上运行了mongodb数据库.
I have a mongodb database running on the default port 27017 in a docker container.
是否有一种方法可以通过在我的ubuntu操作系统上本地运行的mongodb罗盘GUI连接到数据库?
Is there a way to connect to the database with the mongodb compass GUI running natively on my ubuntu OS?
答
docker run -p 27018:27017
,然后使用端口27018从主机上的Compass连接.我看不到公开所有端口的原因.
docker run -p 27018:27017
and then connect from Compass on your host with port 27018. I don't see a reason to expose all ports.