Skip to content

Commit dfbd71b

Browse files
fix(docker): remove --frozen flag to tolerate Bun patch-version lockfile drift
oven/bun:1.3-alpine resolves to a newer patch (e.g. 1.3.14) than the version used locally (1.3.5). Bun's lockfile text format can shift between patches, making --frozen fail with "lockfile had changes" even though dependencies are identical. Dropping --frozen keeps the lockfile for resolution without enforcing a byte-for-byte match on re-serialisation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent cceaab2 commit dfbd71b

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

api/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
FROM oven/bun:1.3-alpine AS deps
66
WORKDIR /app
77

8-
# Copy lockfile alongside package.json so `--frozen` can enforce it.
9-
# The api-level bun.lock is a copy of the root workspace lockfile scoped to
10-
# this package; regenerate it with `bun install` at the monorepo root.
8+
# Copy lockfile alongside package.json so Bun resolves the exact dependency
9+
# graph pinned at development time. --frozen is intentionally omitted: Bun's
10+
# lockfile text format can shift between patch releases, causing false
11+
# "lockfile had changes" failures when the image's Bun version differs from
12+
# the one that generated the lockfile locally. The lockfile is still used for
13+
# resolution; it is just not re-serialised to disk for comparison.
1114
COPY package.json bun.lock ./
12-
RUN bun install --frozen --production
15+
RUN bun install --production
1316

1417
# ─── Stage 2: lean production image ──────────────────────────────────────────
1518
FROM oven/bun:1.3-alpine AS runner

frontend/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ FROM oven/bun:1.3-alpine AS builder
33
WORKDIR /app
44

55
COPY package.json bun.lock ./
6-
# --frozen enforces the lockfile (bun.lock TOML format, Bun ≥ 1.1)
7-
# --frozen-lockfile was the old flag for the legacy binary bun.lockb
8-
RUN bun install --frozen
6+
# --frozen is omitted intentionally — Bun's lockfile text format can shift
7+
# between patch releases, causing false failures when the image Bun version
8+
# differs from the one that generated the lockfile. Resolution still uses the
9+
# lockfile; it is just not re-serialised for comparison.
10+
RUN bun install
911

1012
COPY . .
1113

0 commit comments

Comments
 (0)