max / alloy
- Co-Authored-By
- Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 file changed,
+27 insertions,
-0 deletions
| @@ -46,6 +46,28 @@ | |||
| 46 | 46 | COPY crates/ crates/ | |
| 47 | 47 | RUN cargo build --release --locked | |
| 48 | 48 | ||
| 49 | + | # The console's themes, staged at a path the runtime stage can name. | |
| 50 | + | # | |
| 51 | + | # theme.rs has no built-in palette on purpose (docs/TOKENS.md: no hex in | |
| 52 | + | # Rust), so a console with no theme file on any search path does not fall | |
| 53 | + | # back, it exits. Its last-resort path is makeover's bundled themes, which | |
| 54 | + | # resolve through CARGO_MANIFEST_DIR into the registry checkout — a build | |
| 55 | + | # stage that gets discarded. Only the binary was copied out, so every | |
| 56 | + | # `alloy` subcommand in the image failed with "Theme not found". | |
| 57 | + | # | |
| 58 | + | # Only the two Akari defaults are taken. makeover ships around thirty, | |
| 59 | + | # most of them other people's palettes carrying attribution obligations; | |
| 60 | + | # Akari is the one Alloy is entitled to call its own (docs/TOKENS.md). | |
| 61 | + | # Widening this means shipping THIRD-PARTY-NOTICES alongside it. | |
| 62 | + | # | |
| 63 | + | # The glob is asserted rather than trusted: silently copying nothing here | |
| 64 | + | # would rebuild exactly the failure this fixes. | |
| 65 | + | RUN set -eux; \ | |
| 66 | + | set -- /root/.cargo/registry/src/*/makeover-*/themes; \ | |
| 67 | + | [ "$#" -eq 1 ] && [ -d "$1" ] || { echo "expected one makeover themes dir, got: $*" >&2; exit 1; }; \ | |
| 68 | + | mkdir -p /staged-themes; \ | |
| 69 | + | cp -a "$1/akari-dawn.toml" "$1/akari-night.toml" /staged-themes/ | |
| 70 | + | ||
| 49 | 71 | # ===================================================================== | |
| 50 | 72 | # Runtime image — the bootable container itself. | |
| 51 | 73 | # ===================================================================== | |
| @@ -320,6 +342,11 @@ | |||
| 320 | 342 | # something the operator dropped in. | |
| 321 | 343 | COPY --from=rust-build /src/target/release/alloy /usr/bin/alloy | |
| 322 | 344 | ||
| 345 | + | # The themes that binary refuses to run without. Kept next to it so the | |
| 346 | + | # two move together: shipping the console without these is not a degraded | |
| 347 | + | # console, it is one that exits on launch. | |
| 348 | + | COPY --from=rust-build /staged-themes /usr/share/alloy/themes | |
| 349 | + | ||
| 323 | 350 | # ===================================================================== | |
| 324 | 351 | # bootc validation — fails the build if the image isn't a valid | |
| 325 | 352 | # bootable container. |