diff options
author | gebele <gebele@in-silico.ch> | 2017-03-09 09:21:48 +0000 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2017-03-09 09:21:48 +0000 |
commit | 8c12b3d5c6a9d3da5228a55aaf3231d2d6e60049 (patch) | |
tree | 46dc5bdce555ebdc3d74beee3b15ca31fdbf0763 | |
parent | 6d6ae60f650bbd4674c0470866e0976e2c37b10f (diff) |
added instructions to use a central mongodb in docker env
-rw-r--r-- | _posts/2017-03-07-use-central-mongodb-in-docker-environment.md | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/_posts/2017-03-07-use-central-mongodb-in-docker-environment.md b/_posts/2017-03-07-use-central-mongodb-in-docker-environment.md new file mode 100644 index 0000000..345b39e --- /dev/null +++ b/_posts/2017-03-07-use-central-mongodb-in-docker-environment.md @@ -0,0 +1,32 @@ +--- +layout: post +title: "Use a central mongodb in docker environment for differrent services" +description: "" +category: Installation +tags: [Docker, Mongodb, Database] +--- +{% include JB/setup %} + + +**download and run the mongodb** + + docker pull mongo + docker run --name central-mongo -d mongo + +**you can define the storage engine by name** + + docker run --name central-mongo -d mongo --storageEngine wiredTiger + +**start your service and link the mongodb to it** + + docker run --name my-service --link central-mongo:mongodb -d insilicotox/my-service + +**enter your service container and check the central mongodb network adress** + + docker exec -ti my-service bash + cat /etc/hosts -> 172.17.x.x mongodb + env|grep MONGODB -> MongoPort = tcp://172.17.x.x:27017 + +**use this port for your mongo commands e.g.** + + `mongorestore --host 172.17.x.x` |