From 3c6999509776b84308bbc7bf488796061af5015c Mon Sep 17 00:00:00 2001 From: Sterister Date: Thu, 20 Aug 2026 00:06:02 +0200 Subject: [PATCH] fix(docker): raise fd limit so bun install can extract large tarballs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BuildKit gives each RUN a 1024 soft file-descriptor limit against a ~1M hard limit, and bun extracts tarballs in parallel — a large enough package exhausts the descriptors and the install dies with "Fail extracting tarball". It only shows up inside a build, because `docker run` inherits a far higher limit, which makes it look like a flaky registry. This bit Nova's deploy (on mermaid) and was fixed there; shade-server has the identical pattern and escaped only because its layers were cached, so it would have failed on the next cache-less build. Fixing it at the source too, so a vendor sync cannot silently drop it. Co-Authored-By: Claude Opus 5 (1M context) --- packages/shade-server/Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/shade-server/Dockerfile b/packages/shade-server/Dockerfile index aa17ae6..e7823b1 100644 --- a/packages/shade-server/Dockerfile +++ b/packages/shade-server/Dockerfile @@ -9,10 +9,15 @@ COPY package.json bun.lock tsconfig.json ./ # Copy all packages the server + observer + dashboard need COPY packages ./packages -RUN bun install --frozen-lockfile +# BuildKit gives each RUN a 1024 soft file-descriptor limit while the hard +# limit is ~1M. bun extracts tarballs in parallel, so a large package can +# exhaust the descriptors and the install dies with "Fail extracting tarball" +# — reproducible in a build, invisible outside one because `docker run` +# inherits a far higher limit. Raise the soft limit to what the host allows. +RUN ulimit -n "$(ulimit -Hn)" && bun install --frozen-lockfile # Build the dashboard SPA → dist/, then copy to observer's dist/ -RUN cd packages/shade-dashboard && bun run build +RUN ulimit -n "$(ulimit -Hn)" && cd packages/shade-dashboard && bun run build # ─── Production stage ─────────────────────────────────────── FROM oven/bun:1-alpine