|
...
|
...
|
@@ -66,13 +66,12 @@ run without needing to provide a special configuration file)
|
|
66
|
66
|
RUN mkdir -p /data/db
|
|
67
|
67
|
|
|
68
|
68
|
Finally, we'll expose the standard port that MongoDB runs on (27107) as well as
|
|
69
|
|
-add an entrypoint that runs the standard --help command by default.
|
|
|
69
|
+define an ENTRYPOINT for the container.
|
|
70
|
70
|
|
|
71
|
71
|
.. code-block:: bash
|
|
72
|
72
|
|
|
73
|
73
|
EXPOSE 27017
|
|
74
|
|
- ENTRYPOINT [ "/usr/bin/mongod" ]
|
|
75
|
|
- CMD [ "--help" ]
|
|
|
74
|
+ ENTRYPOINT ["usr/bin/mongod"]
|
|
76
|
75
|
|
|
77
|
76
|
Now, lets build the image which will go through the ``Dockerfile`` we made and
|
|
78
|
77
|
run all of the commands.
|
|
...
|
...
|
@@ -87,10 +86,10 @@ the local port!
|
|
87
|
87
|
.. code-block:: bash
|
|
88
|
88
|
|
|
89
|
89
|
# Regular style
|
|
90
|
|
- MONGO_ID=$(docker run -d <yourname>/mongodb mongod)
|
|
|
90
|
+ MONGO_ID=$(docker run -d <yourname>/mongodb)
|
|
91
|
91
|
|
|
92
|
92
|
# Lean and mean
|
|
93
|
|
- MONGO_ID=$(docker run -d <yourname>/mongodb mongod --noprealloc --smallfiles)
|
|
|
93
|
+ MONGO_ID=$(docker run -d <yourname>/mongodb --noprealloc --smallfiles)
|
|
94
|
94
|
|
|
95
|
95
|
# Check the logs out
|
|
96
|
96
|
docker logs $MONGO_ID
|