Kaynağa Gözat

Merge pull request #1622 from TylerBrock/patch-2

Some fixes for MongoDB example
Andy Rothfusz 12 yıl önce
ebeveyn
işleme
5b84252c73
1 değiştirilmiş dosya ile 6 ekleme ve 4 silme
  1. 6 4
      docs/sources/examples/mongodb.rst

+ 6 - 4
docs/sources/examples/mongodb.rst

@@ -24,7 +24,7 @@ Create an empty file called ``Dockerfile``:
     touch Dockerfile
     touch Dockerfile
 
 
 Next, define the parent image you want to use to build your own image on top of.
 Next, define the parent image you want to use to build your own image on top of.
-Here, we’ll use `CentOS <https://index.docker.io/_/ubuntu/>`_ (tag: ``latest``)
+Here, we’ll use `Ubuntu <https://index.docker.io/_/ubuntu/>`_ (tag: ``latest``)
 available on the `docker index`_:
 available on the `docker index`_:
 
 
 .. code-block:: bash
 .. code-block:: bash
@@ -65,11 +65,13 @@ run without needing to provide a special configuration file)
     # Create the MongoDB data directory
     # Create the MongoDB data directory
     RUN mkdir -p /data/db
     RUN mkdir -p /data/db
 
 
-Finally, we'll expose the standard port that MongoDB runs on (27107)
+Finally, we'll expose the standard port that MongoDB runs on (27107) as well as
+define an ENTRYPOINT for the container.
 
 
 .. code-block:: bash
 .. code-block:: bash
 
 
     EXPOSE 27017
     EXPOSE 27017
+    ENTRYPOINT ["usr/bin/mongod"]
 
 
 Now, lets build the image which will go through the ``Dockerfile`` we made and
 Now, lets build the image which will go through the ``Dockerfile`` we made and
 run all of the commands.
 run all of the commands.
@@ -84,10 +86,10 @@ the local port!
 .. code-block:: bash
 .. code-block:: bash
 
 
     # Regular style
     # Regular style
-    MONGO_ID=$(docker run -d <yourname>/mongodb mongod)
+    MONGO_ID=$(docker run -d <yourname>/mongodb)
 
 
     # Lean and mean
     # Lean and mean
-    MONGO_ID=$(docker run -d <yourname>/mongodb mongod --noprealloc --smallfiles)
+    MONGO_ID=$(docker run -d <yourname>/mongodb --noprealloc --smallfiles)
 
 
     # Check the logs out
     # Check the logs out
     docker logs $MONGO_ID
     docker logs $MONGO_ID