You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/env.md
+202Lines changed: 202 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,3 +226,205 @@ The `DOCKER_COMPUTE_ENVIRONMENTS` environment variable should be a JSON array of
226
226
-**total**: Total number of the resource available.
227
227
-**min**: Minimum number of the resource needed for a job.
228
228
-**max**: Maximum number of the resource for a job.
229
+
230
+
### Docker Registry Authentication
231
+
232
+
-`DOCKER_REGISTRY_AUTHS`: JSON object mapping Docker registry URLs to authentication credentials. Used for accessing private Docker/OCI registries when validating and pulling Docker images. Each registry entry must provide either `username`+`password` or `auth`. Example:
233
+
234
+
```json
235
+
{
236
+
"https://registry-1.docker.io": {
237
+
"username": "myuser",
238
+
"password": "mypassword"
239
+
},
240
+
"https://ghcr.io": {
241
+
"username": "myuser",
242
+
"password": "ghp_..."
243
+
},
244
+
"https://registry.gitlab.com": {
245
+
"auth": "glpat-..."
246
+
}
247
+
}
248
+
```
249
+
250
+
**Configuration Options:**
251
+
252
+
-**Registry URL** (key): The full registry URL including protocol (e.g., `https://registry-1.docker.io`, `https://ghcr.io`, `https://registry.gitlab.com`)
253
+
-**username** (optional): Username for registry authentication. Required if using password-based auth.
254
+
-**password** (optional): Password or personal access token for registry authentication. Required if using username-based auth.
255
+
-**auth** (optional): Authentication token (alternative to username+password). Required if not using username+password.
256
+
257
+
**Notes:**
258
+
259
+
- For Docker Hub (`registry-1.docker.io`), you can use your Docker Hub username and password, or a personal access token (PAT) as the password.
260
+
- For GitHub Container Registry (GHCR), use your GitHub username with a personal access token (PAT) as the password, or use a token directly.
261
+
- For GitLab Container Registry, use a personal access token (PAT) or deploy token.
262
+
- The registry URL must match exactly (including protocol) with the registry used in the Docker image reference.
263
+
- If no credentials are configured for a registry, the node will attempt unauthenticated access (works for public images only).
264
+
265
+
---
266
+
267
+
## Private Docker Registries with Per-Job Authentication
268
+
269
+
In addition to node-level registry authentication via `DOCKER_REGISTRY_AUTHS`, you can provide encrypted Docker registry authentication credentials on a per-job basis. This allows different users to use different private registries or credentials for their compute jobs.
270
+
271
+
### Overview
272
+
273
+
The `encryptedDockerRegistryAuth` parameter allows you to securely provide Docker registry credentials that are:
274
+
275
+
- Encrypted using ECIES (Elliptic Curve Integrated Encryption Scheme) with the node's public key
276
+
- Validated to ensure proper format (either `auth` string OR `username`+`password`)
277
+
- Used only for the specific compute job, overriding node-level configuration if provided
278
+
279
+
### Encryption Format
280
+
281
+
The `encryptedDockerRegistryAuth` must be:
282
+
283
+
1. A JSON object matching the Docker registry auth schema (see below)
284
+
2. Encrypted using ECIES with the node's public key
285
+
3. Hex-encoded as a string
286
+
287
+
**Auth Schema Format:**
288
+
289
+
The decrypted JSON must follow this structure:
290
+
291
+
```json
292
+
{
293
+
"username": "myuser",
294
+
"password": "mypassword"
295
+
}
296
+
```
297
+
298
+
OR
299
+
300
+
```json
301
+
{
302
+
"auth": "base64-encoded-username:password"
303
+
}
304
+
```
305
+
306
+
OR (all fields present)
307
+
308
+
```json
309
+
{
310
+
"username": "myuser",
311
+
"password": "mypassword",
312
+
"auth": "base64-encoded-username:password"
313
+
}
314
+
```
315
+
316
+
**Validation Rules:**
317
+
318
+
- Either `auth` string must be provided (non-empty), OR
319
+
- Both `username` AND `password` must be provided (both non-empty)
To create `encryptedDockerRegistryAuth`, you need to:
393
+
394
+
1.**Prepare the auth JSON object:**
395
+
396
+
```json
397
+
{
398
+
"username": "myuser",
399
+
"password": "mypassword"
400
+
}
401
+
```
402
+
403
+
2.**Get the node's public key** (available via the node's API or P2P interface)
404
+
405
+
3.**Encrypt the JSON string** using ECIES with the node's public key
406
+
407
+
4.**Hex-encode the encrypted result**
408
+
409
+
### Behavior
410
+
411
+
-**Priority**: If `encryptedDockerRegistryAuth` is provided, it takes precedence over node-level `DOCKER_REGISTRY_AUTHS` configuration for that specific job
412
+
-**Validation**: The encrypted auth is decrypted and validated before the job starts. Invalid formats will result in an error
413
+
-**Scope**: The credentials are used for:
414
+
- Validating the Docker image exists (during initialize)
415
+
- Pulling the Docker image (during job execution)
416
+
-**Security**: Credentials are encrypted and only decrypted by the node using its private key
417
+
418
+
### Error Handling
419
+
420
+
If `encryptedDockerRegistryAuth` is invalid, you'll receive an error:
-**Schema validation failure**: `Invalid encryptedDockerRegistryAuth: Either 'auth' must be provided, or both 'username' and 'password' must be provided`
424
+
425
+
### Notes
426
+
427
+
- The `encryptedDockerRegistryAuth` parameter is optional. If not provided, the node will use `DOCKER_REGISTRY_AUTHS` configuration or attempt unauthenticated access
428
+
- The registry URL in the Docker image reference must match the registry you're authenticating to
429
+
- For Docker Hub, use `registry-1.docker.io` as the registry URL
430
+
- Credentials are stored encrypted in the job record and decrypted only when needed for image operations
0 commit comments