WSL中docker网络问题
#5935
Replies: 1 comment
-
Mongo is listening on tcp6 only, which is triggering #4851. You should be able to bind to tcp4 with mongo's config file. Try |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
#在WSL2中安装docker(没有使用docker desktop,而是直接在子系统中安装docker)
##1.启动mongo容器:docker run -itd --name mongo -p 27017:27017 --restart=always -v /data/mongo/data:/data/db mongo:3.2.21
mongo容器启动,在WSL2子系统中可以通过127.0.0.1:27017 进行连接,但是在win10系统中通过127.0.0.1:27017 连接会出现连接失败,无法连接到该网络。不知道怎么解决该问题。
##2.通过docker run -itd --name mongo -p 27017:27017 --restart=always -v /mnt/d/mongo/data:/data/db mongo:3.2.21 来启动mongo容器会出现启动失败,该问题目前也不知道是由什么原因造成的,目前通过上##1的方式来进行启动.
Beta Was this translation helpful? Give feedback.
All reactions