@@ -116,7 +116,7 @@ A private container registry securely stores the Docker images necessary for air
116
116
.. tab :: Linux
117
117
118
118
(Ubuntu) Set up a private Debian package mirror
119
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120
120
We will use Aptly to create a local mirror, although you can also use other options such as debmirror.
121
121
122
122
1. **Install Aptly ** (on an internet-connected machine):
@@ -159,15 +159,15 @@ A private container registry securely stores the Docker images necessary for air
159
159
160
160
7. **Client configuration: ** Configure apt to use your local mirror:
161
161
162
- .. code-block :: bash
162
+ .. code-block :: bash
163
163
164
- cat > /etc/apt/sources.list << EOF
165
- deb http://mirror.example.com/debian bullseye main contrib non-free
166
- EOF
164
+ cat > /etc/apt/sources.list << EOF
165
+ deb http://mirror.example.com/debian bullseye main contrib non-free
166
+ EOF
167
167
168
168
169
169
(RHEL/CentOS) Set up a private RHEL package mirror
170
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171
171
We will use reprosync for a local mirror.
172
172
173
173
1. **Install required tools** (on an internet-connected RHEL system):
@@ -238,7 +238,7 @@ A private container registry securely stores the Docker images necessary for air
238
238
.. tab:: Kubernetes
239
239
240
240
Set up a self-hosted private container registry
241
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
241
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
242
242
243
243
1. **Install Docker Registry**:
244
244
@@ -266,7 +266,7 @@ A private container registry securely stores the Docker images necessary for air
266
266
267
267
b. Run the registry with TLS:
268
268
269
- .. code-block:: bash
269
+ .. code-block:: bash
270
270
271
271
docker run -d -p 5000:5000 --restart=always --name registry \
272
272
-v /mnt/registry:/var/lib/registry \
@@ -276,51 +276,51 @@ A private container registry securely stores the Docker images necessary for air
276
276
registry:2
277
277
278
278
Configure Kubernetes to use private image registries
279
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
279
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
280
280
281
281
When using Kubernetes in an air-gapped environment, you need to configure it to use your private registry.
282
282
283
283
1. **Create a kubernetes secret for registry authentication**:
284
284
285
- .. code-block:: bash
285
+ .. code-block:: bash
286
286
287
- kubectl create secret docker-registry regcred \
288
- --docker-server=registry.example.com:5000 \
289
- --docker-username=your_username \
290
- --docker-password=your_password \
291
-
287
+ kubectl create secret docker-registry regcred \
288
+ --docker-server=registry.example.com:5000 \
289
+ --docker-username=your_username \
290
+ --docker-password=your_password \
291
+
292
292
293
293
2. **Reference the secret in pod specifications**:
294
294
295
- .. code-block:: yaml
295
+ .. code-block:: yaml
296
296
297
- apiVersion: v1
298
- kind: Pod
299
- metadata:
300
- name: mattermost-pod
301
- spec:
302
- containers:
303
- - name: mattermost
304
- image: registry.example.com:5000/mattermost/mattermost-enterprise-edition:latest
305
- imagePullSecrets:
306
- - name: regcred
297
+ apiVersion: v1
298
+ kind: Pod
299
+ metadata:
300
+ name: mattermost-pod
301
+ spec:
302
+ containers:
303
+ - name: mattermost
304
+ image: registry.example.com:5000/mattermost/mattermost-enterprise-edition:latest
305
+ imagePullSecrets:
306
+ - name: regcred
307
307
308
308
3. **For Helm deployments**, specify the registry in ` ` values.yaml` ` :
309
309
310
- .. code-block:: yaml
310
+ .. code-block:: yaml
311
311
312
- image:
313
- repository: registry.example.com:5000/mattermost/mattermost-enterprise-edition
314
- tag: latest
315
- pullPolicy: IfNotPresent
312
+ image:
313
+ repository: registry.example.com:5000/mattermost/mattermost-enterprise-edition
314
+ tag: latest
315
+ pullPolicy: IfNotPresent
316
316
317
- imagePullSecrets:
318
- - name: regcred
317
+ imagePullSecrets:
318
+ - name: regcred
319
319
320
320
.. tab:: Docker
321
321
322
322
Set up a self-hosted private container registry
323
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
323
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
324
324
325
325
1. **Install Docker Registry**:
326
326
@@ -348,7 +348,7 @@ A private container registry securely stores the Docker images necessary for air
348
348
349
349
b. Run the registry with TLS:
350
350
351
- .. code-block:: bash
351
+ .. code-block:: bash
352
352
353
353
docker run -d -p 5000:5000 --restart=always --name registry \
354
354
-v /mnt/registry:/var/lib/registry \
@@ -358,7 +358,7 @@ A private container registry securely stores the Docker images necessary for air
358
358
registry:2
359
359
360
360
Configure Docker to use private image registries
361
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
361
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
362
362
363
363
Configure Docker on all hosts to trust and use your private registry.
364
364
0 commit comments