Skip to content

Commit 9a3075f

Browse files
DOCSP-47788 Document how to change registry/image (#975)
* DOCSP-47788 Document how to change registry/image * DOCSP-47788 updates for JR's feedback * Apply suggestions from code review Co-authored-by: Evelyn Rabil <[email protected]> --------- Co-authored-by: Evelyn Rabil <[email protected]>
1 parent 08ba00c commit 9a3075f

File tree

3 files changed

+168
-0
lines changed

3 files changed

+168
-0
lines changed
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
.. _atlas-cli-pvt-registry-setup:
2+
3+
==============================
4+
Deploy from a Private Registry
5+
==============================
6+
7+
.. meta::
8+
:description: Create a local Atlas deployment from a private registry.
9+
10+
.. default-domain:: mongodb
11+
12+
.. facet::
13+
:name: genre
14+
:values: tutorial
15+
16+
.. contents:: On this page
17+
:local:
18+
:backlinks: none
19+
:depth: 1
20+
:class: singlecol
21+
22+
The {+atlas-cli+} pulls a Docker image and creates a container in order
23+
to deploy the local cluster. By default, the {+atlas-cli+} pulls from
24+
the public Docker Hub `repository
25+
<https://hub.docker.com/r/mongodb/mongodb-atlas-local/tags>`__
26+
``mongodb/mongodb-atlas-local``. You can configure it to pull a specific
27+
image from an internal, typically private, registry.
28+
29+
This page explains how to pull and re-tag the ``mongodb-atlas-local``
30+
container image, push it into a private registry, and then configure the
31+
{+atlas-cli+} to use the private images for :ref:`deploying local
32+
clusters <atlas-cli-deploy-local>`.
33+
34+
Prerequisites
35+
-------------
36+
37+
Before you begin, ensure that you have the following:
38+
39+
- Docker command line tools
40+
- Private container registry for which you have write permission
41+
- A terminal
42+
- {+atlas-cli+}
43+
44+
Procedure
45+
---------
46+
47+
.. procedure::
48+
:style: normal
49+
50+
.. step:: Pull and re-tag the MongoDB Local image for local deployment.
51+
52+
To pull and re-tag, run the following command after replacing the following
53+
placeholder values:
54+
55+
.. list-table::
56+
:stub-columns: 1
57+
58+
* - ``<tag>``
59+
- The tag, which specifies the MongoDB version, that you want
60+
to use in your deployment.
61+
62+
* - ``<container-registry-namespace>``
63+
- The fully qualified path and name of the container registry
64+
namespace for which you have write access.
65+
66+
.. code-block:: shell
67+
68+
docker tag mongodb/mongodb-atlas-local:<tag> <container-registry-namespace>/mongodb-atlas-local:<tag>
69+
70+
.. note::
71+
72+
{+atlas-cli+} supports deploying MongoDB version 7 and 8. In
73+
order to support deploying either version from your registry
74+
using the {+atlas-cli+}, you must repeat this step for 7.0 and
75+
8.0 tags. For the list of available tags, see the `docker hub
76+
repository <https://hub.docker.com/r/mongodb/mongodb-atlas-local/tags>`__.
77+
78+
.. step:: Push the image on your machine to your container registry.
79+
80+
a. Run the following command after replacing the following
81+
placeholder values to push the image to your container
82+
registry:
83+
84+
.. list-table::
85+
:stub-columns: 1
86+
87+
* - ``<tag>``
88+
- The tag, which specifies the MongoDB version, that you want
89+
to use in your deployment.
90+
91+
* - ``<container-registry-namespace>``
92+
- The fully qualified path and name of the container registry
93+
namespace for which you have write access.
94+
95+
.. code-block:: shell
96+
97+
docker push <container-registry-namespace>/mongodb-atlas-local:<tag>
98+
99+
It might take a few minutes for this operation to complete.
100+
101+
.. note::
102+
103+
{+atlas-cli+} supports deploying MongoDB version 7 and 8. In
104+
order to support deploying either version from your registry
105+
using the {+atlas-cli+}, you must repeat this step for 7.0 and
106+
8.0 tags.
107+
108+
#. Verify that the image was successfully uploaded.
109+
110+
You can verify in the following ways:
111+
112+
- Log in to your container registry and verify that the image
113+
was successfully uploaded.
114+
- Run the ``docker pull`` command to pull the image from your
115+
registry to your machine.
116+
117+
.. step:: Configure {+atlas-cli+} to use the image in the registry.
118+
119+
a. Set the ``MONGODB_ATLAS_LOCAL_DEPLOYMENT_IMAGE`` environment
120+
variable after replacing ``<container-registry-namespace>``
121+
with the fully qualified path and name of the container
122+
registry namespace that you created in step 2.
123+
124+
.. code-block:: shell
125+
126+
export MONGODB_ATLAS_LOCAL_DEPLOYMENT_IMAGE=<container-registry-namespace>/mongodb-atlas-local
127+
128+
.. note::
129+
130+
This method only sets the environment variable for the
131+
current terminal session. To persist this setting across
132+
terminal sessions, set this environment variable in your
133+
:ref:`profile stored in the configuration file
134+
<atlas-cli-profiles>`.
135+
136+
#. Verify that the environment variable is set correctly.
137+
138+
.. code-block:: shell
139+
140+
echo $MONGODB_ATLAS_LOCAL_DEPLOYMENT_IMAGE
141+
142+
After you set the environment variable, {+atlas-cli+} uses the
143+
value of the variable instead of the default location for all
144+
deployments.
145+
146+
.. step:: Deploy |service| with your image.
147+
148+
a. Run the following command to start the deployment after
149+
replacing the ``<deploymentName>`` with a name for the
150+
deployment.
151+
152+
.. code-block:: shell
153+
154+
atlas deployments setup <deploymentName>
155+
156+
#. Enter ``local`` when prompted to specify the type of
157+
deployment.
158+
159+
#. Complete the deployment by selecting the appropriate settings
160+
when prompted.
161+
162+
To learn more, see :ref:`atlas-cli-deploy-local`.

source/atlas-cli-env-variables.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ The {+atlas-cli+} supports the following environment variables:
118118
You can also enable or disable telemetry with ``DO_NOT_TRACK``,
119119
but you don't need to specify both.
120120

121+
* - ``MONGODB_ATLAS_LOCAL_DEPLOYMENT_IMAGE``
122+
- String that specifies the container registry with the namespace
123+
and name of the repository that contains the image to use for local
124+
deployments.
125+
121126
* - ``HTTP_PROXY``
122127
- The absolute |url| or the hostname and port in the
123128
``hostname[:port]`` format.

source/atlas-cli-local-cloud.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,6 @@ deployments`` commands:
108108

109109
Create a Local Deployment </atlas-cli-deploy-local>
110110
Deploy with Docker </atlas-cli-deploy-docker>
111+
Deploy from Private Registry </atlas-cli-deploy-pvt-registry>
111112
Use Atlas Search </atlas-cli-deploy-fts>
112113

0 commit comments

Comments
 (0)