Skip to content

Commit 5b6c850

Browse files
authored
DOCS-15385-v6.0-Add-Docker-Community-Install (#2343)
* DOCS-15385 Adding community install page * add procedure * Add detail to procedure * tweak * enhance * add link to installation page * install doc link * Your * add verbiage * add link * community download link * fix * Internal Feedback 1 * add on this page * Internal Review Feedback 2 * add on this page * lab verbiage * add account to docker bullet * Internal Review Feedback 3 * change code blocks to sh * install specific versions 5.0 * add kiosk mode link * * * enteprise typo * remove instruqt lab: * space * Update links and verbiage around community * XR 3 * remove docker hub requirement * remove docker hub requirement * update enteprise language * *
1 parent 26fb24a commit 5b6c850

File tree

4 files changed

+170
-5
lines changed

4 files changed

+170
-5
lines changed

source/administration/install-community.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ These documents provide instructions to install MongoDB Community Edition.
2828
Install MongoDB Community Edition on Windows systems and
2929
optionally start MongoDB as a Windows service.
3030

31+
:ref:`Install with Docker <docker-mongodb-community-install>`
32+
Install a MongoDB Community Docker container.
33+
3134

3235
.. toctree::
3336
:titlesonly:
@@ -36,3 +39,4 @@ These documents provide instructions to install MongoDB Community Edition.
3639
Install on Linux </administration/install-on-linux>
3740
Install on macOS </tutorial/install-mongodb-on-os-x>
3841
Install on Windows </tutorial/install-mongodb-on-windows>
42+
Install with Docker </tutorial/install-mongodb-community-with-docker>

source/installation.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ platforms, for both the Community Edition and the
7676
- :doc:`/tutorial/install-mongodb-enterprise-on-windows`
7777

7878
* - Docker
79-
-
80-
- :doc:`/tutorial/install-mongodb-enterprise-with-docker`
79+
- :ref:`docker-mongodb-community-install`
80+
- :ref:`docker-mongodb-enterprise-install`
8181

8282
.. include:: /includes/unicode-checkmark.rst
8383

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
.. _docker-mongodb-community-install:
2+
3+
======================================
4+
Install MongoDB Community with Docker
5+
======================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
.. _`MongoDB Download Center`: https://www.mongodb.com/try/download/community?tck=docs_server
16+
17+
You can run MongoDB community Edition as a Docker container using the
18+
official MongoDB Community image. Using a Docker image for running your
19+
MongoDB deployment is useful to:
20+
21+
- Stand up a deployment quickly.
22+
- Help manage configuration files.
23+
- Test different features on multiple versions of MongoDB.
24+
25+
About This Task
26+
---------------
27+
28+
This page describes the Docker install instructions for MongoDB Community
29+
edition. The `MongoDB Enterprise Docker image <https://hub.docker.com/r/mongodb/mongodb-enterprise-server>`__
30+
in conjunction with the
31+
`MongoDB Kubernetes Operator <https://hub.docker.com/r/mongodb/mongodb-atlas-kubernetes-operator-prerelease>`__
32+
are recommended for production deployments.
33+
For enterprise instructions, see :ref:`docker-mongodb-enterprise-install`.
34+
35+
This procedure uses the official `mongo community image
36+
<https://hub.docker.com/r/mongodb/mongodb-community-server>`__, which
37+
is maintained by MongoDB.
38+
39+
A full description of `Docker <https://docs.docker.com/>`__ is beyond
40+
the scope of this documentation. This page assumes prior knowledge of
41+
Docker.
42+
43+
Before You Begin
44+
----------------
45+
46+
Before you can run a MongoDB Community Docker container, you must
47+
install `Docker <https://docs.docker.com/install/>`__ .
48+
49+
.. _create-docker-image-community:
50+
51+
Procedure
52+
---------
53+
54+
.. procedure::
55+
:style: normal
56+
57+
.. step:: Pull the MongoDB Docker Image
58+
59+
60+
.. code-block:: sh
61+
62+
docker pull mongodb/mongodb-community-server
63+
64+
.. step:: Run the Image as a Container
65+
66+
.. code-block:: sh
67+
68+
docker run --name mongo -d mongodb/mongodb-community-server:latest
69+
70+
.. note:: Install a Specific Version of MongoDB
71+
72+
To install a specific version of MongoDB, specify the version
73+
after the ``:`` in the Docker run command. Docker pulls and
74+
runs the specified version.
75+
76+
For example, to run MongoDB 5.0:
77+
78+
.. code-block:: sh
79+
80+
docker run --name mongo -d mongodb/mongodb-community-server:5.0-ubi8
81+
82+
For a full list of available MongoDB Community Server images, see:
83+
`the official Docker Hub page <https://hub.docker.com/r/mongodb/mongodb-community-server/tags>`_.
84+
85+
.. step:: Check that the Container is Running
86+
87+
To check the status of your Docker container, run the following
88+
command:
89+
90+
.. code-block:: sh
91+
92+
docker container ls
93+
94+
The output from the ``ls`` command lists the following fields that
95+
describe the running container:
96+
97+
- ``Container ID``
98+
- ``Image``
99+
- ``Command``
100+
- ``Created``
101+
- ``Status``
102+
- ``Port``
103+
- ``Names``
104+
105+
.. code-block:: sh
106+
:copyable: false
107+
108+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
109+
c29db5687290 mongodb/mongodb-community-server:5.0-ubi8 "docker-entrypoint.s…" 4 seconds ago Up 3 seconds 27017/tcp mongo
110+
111+
.. step:: Connect to the MongoDB Deployment with ``mongosh``
112+
113+
Open an interactive container instance of ``mongo`` and connect to
114+
the deployment with ``mongosh``.
115+
116+
.. code-block:: sh
117+
118+
docker exec -it mongo mongosh
119+
120+
.. step:: Validate Your Deployment
121+
122+
To confirm your MongoDB instance is running, run the ``Hello``
123+
command:
124+
125+
.. code-block:: sh
126+
127+
db.runCommand(
128+
{
129+
hello: 1
130+
}
131+
)
132+
133+
The result of this command returns a document describing your
134+
``mongod`` deployment:
135+
136+
.. code-block:: javascript
137+
:copyable: false
138+
139+
{
140+
isWritablePrimary: true,
141+
topologyVersion: {
142+
processId: ObjectId("63c00e27195285e827d48908"),
143+
counter: Long("0")
144+
},
145+
maxBsonObjectSize: 16777216,
146+
maxMessageSizeBytes: 48000000,
147+
maxWriteBatchSize: 100000,
148+
localTime: ISODate("2023-01-12T16:51:10.132Z"),
149+
logicalSessionTimeoutMinutes: 30,
150+
connectionId: 18,
151+
minWireVersion: 0,
152+
maxWireVersion: 20,
153+
readOnly: false,
154+
ok: 1
155+
}

source/tutorial/install-mongodb-enterprise-with-docker.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
.. _docker-mongodb-enterprise-install:
2+
13
======================================
24
Install MongoDB Enterprise with Docker
35
======================================
46

57
.. default-domain:: mongodb
68

7-
.. _`MongoDB Download Center`: https://www.mongodb.com/try/download/enterprise?tck=docs_server
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
814

15+
.. _`MongoDB Download Center`: https://www.mongodb.com/try/download/enterprise?tck=docs_server
916

1017
.. important::
1118

@@ -43,7 +50,7 @@ subject matter before installing MongoDB Enterprise with Docker.
4350
by MongoDB.
4451

4552
The MongoDB community may contribute additional container images.
46-
For a listing of all available images, see the `repositiory
53+
For a listing of all available images, see the `repository
4754
<https://github.com/docker-library/mongo>`__.
4855

4956
.. _create-docker-image-enterprise:
@@ -68,4 +75,3 @@ on using ``docker pull``, reference its documentation
6875
`here <https://docs.docker.com/engine/reference/commandline/pull/#examples>`__.
6976

7077
.. include:: /includes/steps/push-mongodb-with-docker-to-hub.rst
71-

0 commit comments

Comments
 (0)