I am new to dockers.
I have ran a docker container with mongo running it (using boot2docker
)
docker run --name some-mongo -p 27017:27017 -d mongo
inside the docker:
root@8e9b742c127a:/# mongo
MongoDB shell version: 3.0.2
connecting to: test
Server has startup warnings:
2015-05-12T08:49:56.130+0000 I CONTROL [initandlisten]
2015-05-12T08:49:56.130+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-05-12T08:49:56.130+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-05-12T08:49:56.130+0000 I CONTROL [initandlisten]
2015-05-12T08:49:56.130+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-05-12T08:49:56.130+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-05-12T08:49:56.130+0000 I CONTROL [initandlisten]
> show dbs
local 0.078GB
>
docker ps
is
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8e9b742c127a mongo:latest "/entrypoint.sh mong About an hour ago Up About an hour 0.0.0.0:27017->27017/tcp some-mongo
now things get a little tricky since they require network knowledge.
how do I connect to it from out side?
tried:
mongo localhost:27017
docker inspect some-mongo | grep IPAddress "IPAddress": "172.17.0.12", mongo 172.17.0.12:27017
mongo 0.0.0.0:27017
mongo 10.0.0.12:27017
mongo 192.168.3.124:27017