mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 05:42:19 +00:00
build: run the image on the official Node 22 Debian slim image
The runner moves from Wolfi to node:22-trixie-slim, the same image and digest as the dependency and build stages. Wolfi's free repository keeps only its newest Node stream current, so nodejs-22 stayed at 22.23.2 and missed two releases with HIGH fixes; the official image carries 22.23.4. The runner removes npm, npx, corepack and yarn before anything else and fails the build if one is left. The Prisma CLI install moves to its own prisma-cli stage on the same base and is copied over, so npm never runs in the runner. pg_dump and pg_restore 18.6 come from a pgclient stage on postgres:18.6-trixie, pinned by digest, with the libpq they link; the Kerberos, LDAP and SASL libraries come from apt. The PGDG package would bring Perl and the wrapper scripts, and its repository drops a pinned minor once the next one is out. The native ABI and glibc check between builder and runner stays as a guard. runtime-package-pins now holds every stage to a digest, the runner to the builder's image, the runner free of package managers, and the pgclient minor to the bundled database's. Dependabot ignores a PostgreSQL major in the Dockerfile as it does in the compose file.
This commit is contained in:
1 parent
de47cb7b31
commit
b6b693717c
7 files changed
+251
-137
No files matched your search
@@ -224,8 +224,8 @@ describe("release container inputs", () => {
|
||||
const dockerfile = readRepoFile("Dockerfile");
|
||||
const fromLines = dockerfile.match(/^FROM node:[^\n]+$/gm) ?? [];
|
||||
|
||||
// deps and builder; the runner is Wolfi (canvas-binary-hoist-guard).
|
||||
expect(fromLines).toHaveLength(2);
|
||||
// deps, builder, the prisma-cli install and the runner.
|
||||
expect(fromLines).toHaveLength(4);
|
||||
expect(new Set(fromLines.map((line) => line.split(" AS ")[0]))).toEqual(
|
||||
new Set([
|
||||
"FROM node:22-trixie-slim@sha256:2117f713a417f3aff682ac8f5bc2ebbdf1beed51f36e67ab1e0fd3866b6d2d8f",
|
||||
@@ -244,11 +244,14 @@ describe("release container inputs", () => {
|
||||
expect(
|
||||
dockerfile.match(/corepack prepare pnpm@11\.15\.1 --activate/g),
|
||||
).toHaveLength(2);
|
||||
// The runner installs npm for the Prisma CLI step only, removes it in the
|
||||
// same layer, and fails the build if any package manager is left.
|
||||
expect(dockerfile).toContain("apk del --no-cache npm");
|
||||
// The Prisma CLI is installed in its own stage and copied over; the
|
||||
// runner removes the base image's package managers and fails the build
|
||||
// if any is left (runtime-package-pins holds the rest).
|
||||
expect(dockerfile).toContain(
|
||||
"sh -c '! command -v npm && ! command -v npx && ! command -v corepack && ! command -v pnpm'",
|
||||
"COPY --from=prisma-cli /opt/prisma-cli /opt/prisma-cli",
|
||||
);
|
||||
expect(dockerfile).toContain(
|
||||
"sh -c '! command -v npm && ! command -v npx && ! command -v corepack && ! command -v yarn && ! command -v pnpm'",
|
||||
);
|
||||
expect(dockerfile).toContain("tsx@4.23.1");
|
||||
expect(dockerfile).toContain(
|
||||
|
||||
Reference in new issue
Block a user