@git.zone/tsdocker 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.smartconfig.json +27 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/package.json +2 -2
- package/readme.hints.md +12 -10
- package/readme.md +87 -83
- package/ts/00_commitinfo_data.ts +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"npmts": {
|
|
3
|
+
"mode": "default",
|
|
4
|
+
"cli": true
|
|
5
|
+
},
|
|
6
|
+
"@git.zone/cli": {
|
|
7
|
+
"projectType": "npm",
|
|
8
|
+
"module": {
|
|
9
|
+
"githost": "gitlab.com",
|
|
10
|
+
"gitscope": "gitzone",
|
|
11
|
+
"gitrepo": "tsdocker",
|
|
12
|
+
"description": "develop npm modules cross platform with docker",
|
|
13
|
+
"npmPackagename": "@git.zone/tsdocker",
|
|
14
|
+
"license": "MIT"
|
|
15
|
+
},
|
|
16
|
+
"release": {
|
|
17
|
+
"accessLevel": "public",
|
|
18
|
+
"registries": [
|
|
19
|
+
"https://verdaccio.lossless.digital",
|
|
20
|
+
"https://registry.npmjs.org"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"@ship.zone/szci": {
|
|
25
|
+
"npmGlobalTools": []
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@git.zone/tsdocker',
|
|
6
|
-
version: '2.2.
|
|
6
|
+
version: '2.2.3',
|
|
7
7
|
description: 'develop npm modules cross platform with docker'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxvQkFBb0I7SUFDMUIsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLGdEQUFnRDtDQUM5RCxDQUFBIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@git.zone/tsdocker",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "develop npm modules cross platform with docker",
|
|
6
6
|
"main": "dist_ts/index.js",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"dist_ts_web/**/*",
|
|
56
56
|
"assets/**/*",
|
|
57
57
|
"cli.js",
|
|
58
|
-
"
|
|
58
|
+
".smartconfig.json",
|
|
59
59
|
"readme.md"
|
|
60
60
|
],
|
|
61
61
|
"pnpm": {
|
package/readme.hints.md
CHANGED
|
@@ -3,22 +3,23 @@
|
|
|
3
3
|
## Module Purpose
|
|
4
4
|
|
|
5
5
|
tsdocker is a comprehensive Docker development and building tool. It provides:
|
|
6
|
+
|
|
6
7
|
- Building Dockerfiles with dependency ordering
|
|
7
8
|
- Multi-registry push/pull support
|
|
8
9
|
- Multi-architecture builds (amd64/arm64)
|
|
9
10
|
|
|
10
11
|
## New CLI Commands (2026-01-19)
|
|
11
12
|
|
|
12
|
-
| Command
|
|
13
|
-
|
|
14
|
-
| `tsdocker`
|
|
15
|
-
| `tsdocker build`
|
|
16
|
-
| `tsdocker push [registry]` | Push images to configured registries
|
|
17
|
-
| `tsdocker pull <registry>` | Pull images from registry
|
|
18
|
-
| `tsdocker test`
|
|
19
|
-
| `tsdocker login`
|
|
20
|
-
| `tsdocker list`
|
|
21
|
-
| `tsdocker clean --all`
|
|
13
|
+
| Command | Description |
|
|
14
|
+
| -------------------------- | ---------------------------------------------- |
|
|
15
|
+
| `tsdocker` | Show usage / man page |
|
|
16
|
+
| `tsdocker build` | Build all Dockerfiles with dependency ordering |
|
|
17
|
+
| `tsdocker push [registry]` | Push images to configured registries |
|
|
18
|
+
| `tsdocker pull <registry>` | Pull images from registry |
|
|
19
|
+
| `tsdocker test` | Run container tests (test scripts) |
|
|
20
|
+
| `tsdocker login` | Login to configured registries |
|
|
21
|
+
| `tsdocker list` | List discovered Dockerfiles and dependencies |
|
|
22
|
+
| `tsdocker clean --all` | Clean up Docker environment |
|
|
22
23
|
|
|
23
24
|
## Configuration
|
|
24
25
|
|
|
@@ -106,6 +107,7 @@ Implementation: `Dockerfile.computeLevels()` groups topologically sorted Dockerf
|
|
|
106
107
|
All builds now go through a persistent local registry (`localhost:5234`) with volume storage at `.nogit/docker-registry/`. Pushes use the `RegistryCopy` class (`ts/classes.registrycopy.ts`) which implements the OCI Distribution API to copy images (including multi-arch manifest lists) from the local registry to remote registries. This replaces the old `docker tag + docker push` approach that only worked for single-platform images.
|
|
107
108
|
|
|
108
109
|
Key classes:
|
|
110
|
+
|
|
109
111
|
- `RegistryCopy` — HTTP-based OCI image copy (auth, blob transfer, manifest handling)
|
|
110
112
|
- `Dockerfile.push()` — Now delegates to `RegistryCopy.copyImage()`
|
|
111
113
|
- `Dockerfile.needsLocalRegistry()` — Always returns true
|
package/readme.md
CHANGED
|
@@ -44,6 +44,7 @@ tsdocker build
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
tsdocker will:
|
|
47
|
+
|
|
47
48
|
1. 🔍 Discover all `Dockerfile*` files in your project
|
|
48
49
|
2. 📊 Analyze `FROM` dependencies between them
|
|
49
50
|
3. 🔄 Sort them topologically
|
|
@@ -84,64 +85,64 @@ tsdocker push --no-build Dockerfile_api Dockerfile_web
|
|
|
84
85
|
|
|
85
86
|
## CLI Commands
|
|
86
87
|
|
|
87
|
-
| Command
|
|
88
|
-
|
|
89
|
-
| `tsdocker`
|
|
90
|
-
| `tsdocker build`
|
|
91
|
-
| `tsdocker push`
|
|
92
|
-
| `tsdocker pull <registry>` | Pull images from a specific registry
|
|
93
|
-
| `tsdocker test`
|
|
94
|
-
| `tsdocker login`
|
|
95
|
-
| `tsdocker list`
|
|
96
|
-
| `tsdocker config`
|
|
97
|
-
| `tsdocker clean`
|
|
88
|
+
| Command | Description |
|
|
89
|
+
| -------------------------- | ------------------------------------------------------------ |
|
|
90
|
+
| `tsdocker` | Show usage / man page |
|
|
91
|
+
| `tsdocker build` | Build all Dockerfiles with dependency ordering |
|
|
92
|
+
| `tsdocker push` | Build + push images to configured registries |
|
|
93
|
+
| `tsdocker pull <registry>` | Pull images from a specific registry |
|
|
94
|
+
| `tsdocker test` | Build + run container test scripts (`test_*.sh`) |
|
|
95
|
+
| `tsdocker login` | Authenticate with configured registries |
|
|
96
|
+
| `tsdocker list` | Display discovered Dockerfiles and their dependencies |
|
|
97
|
+
| `tsdocker config` | Manage global tsdocker configuration (remote builders, etc.) |
|
|
98
|
+
| `tsdocker clean` | Interactively clean Docker environment |
|
|
98
99
|
|
|
99
100
|
### Build Flags
|
|
100
101
|
|
|
101
|
-
| Flag
|
|
102
|
-
|
|
103
|
-
| `<patterns>`
|
|
104
|
-
| `--platform=linux/arm64` | Override build platform for a single architecture
|
|
105
|
-
| `--timeout=600`
|
|
106
|
-
| `--no-cache`
|
|
107
|
-
| `--cached`
|
|
108
|
-
| `--verbose`
|
|
109
|
-
| `--parallel`
|
|
110
|
-
| `--parallel=8`
|
|
111
|
-
| `--context=mycontext`
|
|
102
|
+
| Flag | Description |
|
|
103
|
+
| ------------------------ | ------------------------------------------------------------------------------- |
|
|
104
|
+
| `<patterns>` | Positional Dockerfile name patterns (e.g. `Dockerfile_base`, `Dockerfile_app*`) |
|
|
105
|
+
| `--platform=linux/arm64` | Override build platform for a single architecture |
|
|
106
|
+
| `--timeout=600` | Build timeout in seconds |
|
|
107
|
+
| `--no-cache` | Force rebuild without Docker layer cache |
|
|
108
|
+
| `--cached` | Skip unchanged Dockerfiles (content-hash based) |
|
|
109
|
+
| `--verbose` | Stream raw `docker build` output |
|
|
110
|
+
| `--parallel` | Enable level-based parallel builds (default concurrency: 4) |
|
|
111
|
+
| `--parallel=8` | Parallel builds with custom concurrency |
|
|
112
|
+
| `--context=mycontext` | Use a specific Docker context |
|
|
112
113
|
|
|
113
114
|
### Push Flags
|
|
114
115
|
|
|
115
|
-
| Flag
|
|
116
|
-
|
|
117
|
-
| `<patterns>`
|
|
118
|
-
| `--registry=<url>` | Push to a single specific registry instead of all configured
|
|
119
|
-
| `--no-build`
|
|
116
|
+
| Flag | Description |
|
|
117
|
+
| ------------------ | ------------------------------------------------------------------- |
|
|
118
|
+
| `<patterns>` | Positional Dockerfile name patterns to select which images to push |
|
|
119
|
+
| `--registry=<url>` | Push to a single specific registry instead of all configured |
|
|
120
|
+
| `--no-build` | Skip the build phase; only push existing images from local registry |
|
|
120
121
|
|
|
121
122
|
### Config Subcommands
|
|
122
123
|
|
|
123
|
-
| Subcommand
|
|
124
|
-
|
|
125
|
-
| `add-builder`
|
|
126
|
-
| `remove-builder` | Remove a remote builder by name
|
|
127
|
-
| `list-builders`
|
|
128
|
-
| `show`
|
|
124
|
+
| Subcommand | Description |
|
|
125
|
+
| ---------------- | ----------------------------------- |
|
|
126
|
+
| `add-builder` | Add or update a remote builder node |
|
|
127
|
+
| `remove-builder` | Remove a remote builder by name |
|
|
128
|
+
| `list-builders` | List all configured remote builders |
|
|
129
|
+
| `show` | Show the full global configuration |
|
|
129
130
|
|
|
130
131
|
**`add-builder` flags:**
|
|
131
132
|
|
|
132
|
-
| Flag
|
|
133
|
-
|
|
134
|
-
| `--name=<name>`
|
|
135
|
-
| `--host=<user@ip>` | SSH host (e.g. `armbuilder@192.168.1.100`)
|
|
136
|
-
| `--platform=<p>`
|
|
133
|
+
| Flag | Description |
|
|
134
|
+
| ------------------ | --------------------------------------------------------- |
|
|
135
|
+
| `--name=<name>` | Builder name (e.g. `arm64-builder`) |
|
|
136
|
+
| `--host=<user@ip>` | SSH host (e.g. `armbuilder@192.168.1.100`) |
|
|
137
|
+
| `--platform=<p>` | Target platform (e.g. `linux/arm64`) |
|
|
137
138
|
| `--ssh-key=<path>` | SSH key path (optional, uses SSH agent/config by default) |
|
|
138
139
|
|
|
139
140
|
### Clean Flags
|
|
140
141
|
|
|
141
|
-
| Flag
|
|
142
|
-
|
|
142
|
+
| Flag | Description |
|
|
143
|
+
| ------- | -------------------------------------------------- |
|
|
143
144
|
| `--all` | Include all images and volumes (not just dangling) |
|
|
144
|
-
| `-y`
|
|
145
|
+
| `-y` | Auto-confirm all prompts |
|
|
145
146
|
|
|
146
147
|
## Configuration
|
|
147
148
|
|
|
@@ -167,13 +168,13 @@ Configure tsdocker in your `package.json` or `npmextra.json` under the `@git.zon
|
|
|
167
168
|
|
|
168
169
|
#### Build & Push Options
|
|
169
170
|
|
|
170
|
-
| Option
|
|
171
|
-
|
|
172
|
-
| `registries`
|
|
173
|
-
| `registryRepoMap` | `object`
|
|
174
|
-
| `buildArgEnvMap`
|
|
175
|
-
| `platforms`
|
|
176
|
-
| `testDir`
|
|
171
|
+
| Option | Type | Default | Description |
|
|
172
|
+
| ----------------- | ---------- | ----------------- | ---------------------------------------------- |
|
|
173
|
+
| `registries` | `string[]` | `[]` | Registry URLs to push to |
|
|
174
|
+
| `registryRepoMap` | `object` | `{}` | Map registries to different repository paths |
|
|
175
|
+
| `buildArgEnvMap` | `object` | `{}` | Map Docker build ARGs to environment variables |
|
|
176
|
+
| `platforms` | `string[]` | `["linux/amd64"]` | Target architectures for multi-arch builds |
|
|
177
|
+
| `testDir` | `string` | `./test` | Directory containing test scripts |
|
|
177
178
|
|
|
178
179
|
## Architecture: How tsdocker Works
|
|
179
180
|
|
|
@@ -217,12 +218,12 @@ tsdocker uses a **local OCI registry** as the canonical store for all built imag
|
|
|
217
218
|
|
|
218
219
|
### 🔑 Why a Local Registry?
|
|
219
220
|
|
|
220
|
-
| Problem
|
|
221
|
-
|
|
222
|
-
| `docker buildx --load` fails for multi-arch images
|
|
223
|
-
| `docker push` only pushes single-platform manifests | OCI API copy preserves full manifest lists (multi-arch)
|
|
224
|
-
| Images lost between build and push phases
|
|
225
|
-
| Redundant blob uploads on incremental pushes
|
|
221
|
+
| Problem | Solution |
|
|
222
|
+
| --------------------------------------------------- | ------------------------------------------------------------------- |
|
|
223
|
+
| `docker buildx --load` fails for multi-arch images | `buildx --push` to local registry works for any number of platforms |
|
|
224
|
+
| `docker push` only pushes single-platform manifests | OCI API copy preserves full manifest lists (multi-arch) |
|
|
225
|
+
| Images lost between build and push phases | Persistent storage at `.nogit/docker-registry/` survives restarts |
|
|
226
|
+
| Redundant blob uploads on incremental pushes | HEAD checks skip blobs that already exist on the remote |
|
|
226
227
|
|
|
227
228
|
### 🔁 Resilient Push
|
|
228
229
|
|
|
@@ -246,12 +247,12 @@ Every tsdocker invocation gets its own **session** with unique:
|
|
|
246
247
|
|
|
247
248
|
This prevents resource conflicts when multiple CI jobs run tsdocker in parallel. Auto-detected CI systems:
|
|
248
249
|
|
|
249
|
-
| Environment Variable | CI System
|
|
250
|
-
|
|
251
|
-
| `GITEA_ACTIONS`
|
|
252
|
-
| `GITHUB_ACTIONS`
|
|
253
|
-
| `GITLAB_CI`
|
|
254
|
-
| `CI`
|
|
250
|
+
| Environment Variable | CI System |
|
|
251
|
+
| -------------------- | -------------- |
|
|
252
|
+
| `GITEA_ACTIONS` | Gitea Actions |
|
|
253
|
+
| `GITHUB_ACTIONS` | GitHub Actions |
|
|
254
|
+
| `GITLAB_CI` | GitLab CI |
|
|
255
|
+
| `CI` | Generic CI |
|
|
255
256
|
|
|
256
257
|
In local dev, no suffix is added — keeping a persistent builder for faster rebuilds.
|
|
257
258
|
|
|
@@ -259,11 +260,11 @@ In local dev, no suffix is added — keeping a persistent builder for faster reb
|
|
|
259
260
|
|
|
260
261
|
tsdocker automatically detects your Docker environment topology:
|
|
261
262
|
|
|
262
|
-
| Topology
|
|
263
|
-
|
|
264
|
-
| `local`
|
|
265
|
-
| `socket-mount` | `/.dockerenv` exists
|
|
266
|
-
| `dind`
|
|
263
|
+
| Topology | Detection | Meaning |
|
|
264
|
+
| -------------- | ---------------------------------- | ----------------------------------------------------- |
|
|
265
|
+
| `local` | Default | Standard Docker installation on the host |
|
|
266
|
+
| `socket-mount` | `/.dockerenv` exists | Running inside a container with Docker socket mounted |
|
|
267
|
+
| `dind` | `DOCKER_HOST` starts with `tcp://` | Docker-in-Docker setup |
|
|
267
268
|
|
|
268
269
|
Context-aware builder names (`tsdocker-builder-<context>`) prevent conflicts across Docker contexts. Rootless Docker configurations trigger appropriate warnings.
|
|
269
270
|
|
|
@@ -309,6 +310,7 @@ Build for multiple platforms using Docker Buildx:
|
|
|
309
310
|
```
|
|
310
311
|
|
|
311
312
|
tsdocker automatically:
|
|
313
|
+
|
|
312
314
|
- Sets up a Buildx builder with `--driver-opt network=host` (so buildx can reach the local registry)
|
|
313
315
|
- Pushes multi-platform images to the local registry via `buildx --push`
|
|
314
316
|
- Copies the full manifest list (including all platform variants) to remote registries on `tsdocker push`
|
|
@@ -354,6 +356,7 @@ When remote builders are configured and the project's `platforms` includes a mat
|
|
|
354
356
|
```
|
|
355
357
|
|
|
356
358
|
**Prerequisites for the remote machine:**
|
|
359
|
+
|
|
357
360
|
- Docker installed and running
|
|
358
361
|
- A user with Docker group access (no sudo needed)
|
|
359
362
|
- SSH key access configured
|
|
@@ -379,11 +382,11 @@ tsdocker groups Dockerfiles into **dependency levels** using topological analysi
|
|
|
379
382
|
|
|
380
383
|
tsdocker discovers files matching `Dockerfile*`:
|
|
381
384
|
|
|
382
|
-
| File Name
|
|
383
|
-
|
|
384
|
-
| `Dockerfile`
|
|
385
|
-
| `Dockerfile_v1.0.0`
|
|
386
|
-
| `Dockerfile_alpine`
|
|
385
|
+
| File Name | Version Tag |
|
|
386
|
+
| ------------------------ | --------------------------- |
|
|
387
|
+
| `Dockerfile` | `latest` |
|
|
388
|
+
| `Dockerfile_v1.0.0` | `v1.0.0` |
|
|
389
|
+
| `Dockerfile_alpine` | `alpine` |
|
|
387
390
|
| `Dockerfile_##version##` | Uses `package.json` version |
|
|
388
391
|
|
|
389
392
|
### 🎯 Dockerfile Filtering
|
|
@@ -492,6 +495,7 @@ tsdocker list
|
|
|
492
495
|
```
|
|
493
496
|
|
|
494
497
|
Output:
|
|
498
|
+
|
|
495
499
|
```
|
|
496
500
|
Discovered Dockerfiles:
|
|
497
501
|
========================
|
|
@@ -556,7 +560,7 @@ build-and-push:
|
|
|
556
560
|
- npm install -g @git.zone/tsdocker
|
|
557
561
|
- tsdocker push
|
|
558
562
|
variables:
|
|
559
|
-
DOCKER_REGISTRY_1:
|
|
563
|
+
DOCKER_REGISTRY_1: 'registry.gitlab.com|$CI_REGISTRY_USER|$CI_REGISTRY_PASSWORD'
|
|
560
564
|
```
|
|
561
565
|
|
|
562
566
|
**GitHub Actions:**
|
|
@@ -568,7 +572,7 @@ build-and-push:
|
|
|
568
572
|
tsdocker login
|
|
569
573
|
tsdocker push
|
|
570
574
|
env:
|
|
571
|
-
DOCKER_REGISTRY_1:
|
|
575
|
+
DOCKER_REGISTRY_1: 'ghcr.io|${{ github.actor }}|${{ secrets.GITHUB_TOKEN }}'
|
|
572
576
|
```
|
|
573
577
|
|
|
574
578
|
**Gitea Actions:**
|
|
@@ -579,7 +583,7 @@ build-and-push:
|
|
|
579
583
|
npm install -g @git.zone/tsdocker
|
|
580
584
|
tsdocker push
|
|
581
585
|
env:
|
|
582
|
-
DOCKER_REGISTRY_1:
|
|
586
|
+
DOCKER_REGISTRY_1: 'gitea.example.com|${{ secrets.REGISTRY_USER }}|${{ secrets.REGISTRY_PASSWORD }}'
|
|
583
587
|
```
|
|
584
588
|
|
|
585
589
|
tsdocker auto-detects all three CI systems and enables session isolation automatically — no extra configuration needed.
|
|
@@ -607,20 +611,20 @@ await manager.push();
|
|
|
607
611
|
|
|
608
612
|
### CI & Session Control
|
|
609
613
|
|
|
610
|
-
| Variable
|
|
611
|
-
|
|
612
|
-
| `TSDOCKER_SESSION_ID`
|
|
613
|
-
| `TSDOCKER_REGISTRY_PORT` | Override the dynamically allocated local registry port
|
|
614
|
-
| `CI`
|
|
614
|
+
| Variable | Description |
|
|
615
|
+
| ------------------------ | -------------------------------------------------------------------------- |
|
|
616
|
+
| `TSDOCKER_SESSION_ID` | Override the auto-generated session ID (default: random 8-char hex) |
|
|
617
|
+
| `TSDOCKER_REGISTRY_PORT` | Override the dynamically allocated local registry port |
|
|
618
|
+
| `CI` | Generic CI detection (also `GITHUB_ACTIONS`, `GITLAB_CI`, `GITEA_ACTIONS`) |
|
|
615
619
|
|
|
616
620
|
### Registry Credentials
|
|
617
621
|
|
|
618
|
-
| Variable
|
|
619
|
-
|
|
622
|
+
| Variable | Description |
|
|
623
|
+
| ------------------------------------------------ | ---------------------------------------------- |
|
|
620
624
|
| `DOCKER_REGISTRY_1` through `DOCKER_REGISTRY_10` | Pipe-delimited: `registry\|username\|password` |
|
|
621
|
-
| `DOCKER_REGISTRY_URL`
|
|
622
|
-
| `DOCKER_REGISTRY_USER`
|
|
623
|
-
| `DOCKER_REGISTRY_PASSWORD`
|
|
625
|
+
| `DOCKER_REGISTRY_URL` | Registry URL for single-registry setup |
|
|
626
|
+
| `DOCKER_REGISTRY_USER` | Username for single-registry setup |
|
|
627
|
+
| `DOCKER_REGISTRY_PASSWORD` | Password for single-registry setup |
|
|
624
628
|
|
|
625
629
|
## Requirements
|
|
626
630
|
|