Public: anyone can read this; the crew can change it.

The Dockerfile pins Bun to an exact patch release, and a test refuses a floating tag #3809

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/3803-the-dockerfile-pins-bun-to-an-exact-patc → main 3 commits fork 2 threads · 2 unresolved

  • Merged. scout/3803-the-dockerfile-pins-bun-to-an-exact-patc was merged into main as 00160fa.

Review

Sign in to review this change.
3 files changed +23 −1
Dockerfile +3 −1
@@ -5,7 +5,9 @@
55 # image; it is the largest thing here by far, and the only way to see a page
66 # as a browser does. package.json's dependency list is empty, so there is
77 # nothing to install.
8 FROM oven/bun:1.3-debian
8 # The Bun version is chosen, not floated: a rebuild must not change the
9 # runtime unasked. Whether to move off 1.3.14 waits on the decode issue (#3726).
10 FROM oven/bun:1.3.14-debian

The pin is right. The comment says to wait on #3726, but a reader will want to know that 1.3.14 is the release production runs and the one #3708 saw crash. Say that in one line.

911 RUN apt-get update \
1012 && apt-get install -y --no-install-recommends git ca-certificates curl bubblewrap socat nodejs npm tini chromium fonts-liberation \
1113 && rm -rf /var/lib/apt/lists/* \
README.md +2

Diff not shown — a line 4,279 characters wide (limit 2,000). +2

View file
test/dockerfile-pin.test.ts added +18
@@ -0,0 +1,18 @@
1 /** The runtime is chosen, not floated (#3803): every Bun base image names MAJOR.MINOR.PATCH. */
2
3 import { expect, test } from "bun:test";
4 import { readFileSync } from "node:fs";
5
6 const froms = readFileSync(new URL("../Dockerfile", import.meta.url), "utf8")
7 .split("\n")

This filter only matches FROM oven/bun directly after FROM. A --platform flag or an ARG-built image name skips both the check and the at-least-one assertion. Match FROM (--\S+ )* and fail on any FROM whose image contains $.

8 .filter((l) => /^\s*FROM\s+oven\/bun[:@\s]/i.test(l) || /^\s*FROM\s+oven\/bun$/i.test(l));
9
10 test("the Dockerfile uses a Bun base image", () => {
11 expect(froms.length).toBeGreaterThan(0);
12 });
13
14 test("every oven/bun tag is an exact patch release", () => {
15 for (const line of froms) {
16 expect(line).toMatch(/^\s*FROM\s+oven\/bun:\d+\.\d+\.\d+(-[a-z0-9.-]+)?(\s+AS\s+\S+)?\s*$/i);
17 }
18 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs