alexandr 0.3.1 → 0.3.2
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/package.json +1 -1
- package/src/commands.js +7 -2
- package/src/instance.js +12 -0
- package/templates/docker-compose.yml +5 -0
- package/templates/env.example +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alexandr",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Run the alexandr workspace runtime locally (npx alexandr up), and develop alexandr apps against a workspace (alexandr app link | dev | build | deploy).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/commands.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./docker.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveInstance, isMaterialized, materialize, readEnv, envHas, setEnv,
|
|
18
|
-
unsetEnv, kernelPort, pruneSnapshots,
|
|
18
|
+
unsetEnv, kernelPort, pruneSnapshots, dockerConfigDir,
|
|
19
19
|
} from "./instance.js";
|
|
20
20
|
export { updater } from "./updater.js";
|
|
21
21
|
import { kernelUrl, health, version as kVersion, waitHealthy, waitPosture } from "./probe.js";
|
|
@@ -111,7 +111,12 @@ function profileArgs(dir) {
|
|
|
111
111
|
function stampUpdaterEnv(inst) {
|
|
112
112
|
setEnv(inst.dir, "ALEXANDR_INSTANCE_DIR", hostPath(inst.dir));
|
|
113
113
|
setEnv(inst.dir, "ALEXANDR_COMPOSE_PROJECT", inst.projectName);
|
|
114
|
-
if (process.env.ALEXANDR_UPDATER_INSIDE !== "1")
|
|
114
|
+
if (process.env.ALEXANDR_UPDATER_INSIDE !== "1") {
|
|
115
|
+
setEnv(inst.dir, "ALEXANDR_UPDATER_IMAGE_TAG", pkgVersion());
|
|
116
|
+
// The host's docker config, so the sidecar's pulls carry this box's registry login
|
|
117
|
+
// (found on the first real press: an anonymous pull of the private image → `unauthorized`).
|
|
118
|
+
setEnv(inst.dir, "ALEXANDR_DOCKER_CONFIG", hostPath(dockerConfigDir()));
|
|
119
|
+
}
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
/**
|
package/src/instance.js
CHANGED
|
@@ -128,6 +128,18 @@ export function pruneSnapshots(dir, keep = 3) {
|
|
|
128
128
|
return removed;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Where THIS host's Docker CLI keeps its config — the registry login `alexandr up`/`login`
|
|
133
|
+
* wrote (`docker login` honours `DOCKER_CONFIG`, else `~/.docker`). The updater sidecar mounts
|
|
134
|
+
* it read-only: a pull's credential is sent by the client, not held by the daemon, so a docker
|
|
135
|
+
* CLI inside the sidecar with no config pulls anonymously and the private kernel image answers
|
|
136
|
+
* `unauthorized` — exactly what the first real press did (aos, 2026-09-08).
|
|
137
|
+
*/
|
|
138
|
+
export function dockerConfigDir(env = process.env, home = os.homedir()) {
|
|
139
|
+
const explicit = (env.DOCKER_CONFIG || "").trim();
|
|
140
|
+
return explicit || path.join(home, ".docker");
|
|
141
|
+
}
|
|
142
|
+
|
|
131
143
|
export function kernelPort(dir) {
|
|
132
144
|
const v = readEnv(dir).ALEXANDR_KERNEL_PORT;
|
|
133
145
|
const n = v ? Number(v) : 3030;
|
|
@@ -54,6 +54,11 @@ services:
|
|
|
54
54
|
volumes:
|
|
55
55
|
- /var/run/docker.sock:/var/run/docker.sock # THE socket. Only here.
|
|
56
56
|
- ${ALEXANDR_INSTANCE_DIR:-/nonexistent}:${ALEXANDR_INSTANCE_DIR:-/nonexistent}
|
|
57
|
+
# The host's Docker CONFIG, read-only — the registry login `alexandr up`/`login` wrote
|
|
58
|
+
# lives there, and a pull's credential is sent by the CLIENT, not held by the daemon:
|
|
59
|
+
# without this the sidecar's own docker CLI pulls anonymously and the private kernel
|
|
60
|
+
# image answers `unauthorized` (found on the first real press, aos, 2026-09-08).
|
|
61
|
+
- ${ALEXANDR_DOCKER_CONFIG:-/nonexistent}:/root/.docker:ro
|
|
57
62
|
- updater_run:/run/alexandr
|
|
58
63
|
restart: unless-stopped
|
|
59
64
|
|
package/templates/env.example
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
# ALEXANDR_INSTANCE_DIR= # this directory, at its host path (mounted at the same path)
|
|
20
20
|
# ALEXANDR_COMPOSE_PROJECT= # the compose project the sidecar drives (the host's, verbatim)
|
|
21
21
|
# ALEXANDR_UPDATER_IMAGE_TAG= # the CLI version that installed it (= the sidecar's version)
|
|
22
|
+
# ALEXANDR_DOCKER_CONFIG= # this host's docker config dir (its registry login), mounted read-only
|
|
22
23
|
|
|
23
24
|
# ---- account link (REQUIRED — the runtime refuses to serve unlinked) --------
|
|
24
25
|
# Every runtime must be linked to an alexandr account before it serves anyone
|