Skip to content

Use the project’s Bun version for the base image - #174

Merged
tomr-fly merged 1 commit into
mainfrom
tomr/bun-base-image-version
Nov 29, 2026
Merged

tomr-fly merged 1 commit into
mainfrom
tomr/bun-base-image-version

Conversation

@tomr-fly

@tomr-fly tomr-fly commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Generating a Dockerfile without Bun installed can produce oven/bun:-slim. Use the project’s exact stable Bun pin first, then the installed Bun version, then 1. This also keeps the generated Dockerfile using Bun for install and prune steps when Bun is missing locally.

Fixes #173.

@tomr-fly tomr-fly self-assigned this Nov 29, 2026
@tomr-fly tomr-fly added the bug Something isn't working label Nov 29, 2026
@tomr-fly
tomr-fly requested a lite review from Copilot November 29, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical test remains broken because the second sandbox run retains the previous packageManager: "bun@1.2.20", producing BUN_VERSION=1.2.20 instead of the expected fallback value 1.

1 open issue
What changed in this PR

Updates Bun version resolution so generated Dockerfiles use the project's exact stable Bun pin, then the locally installed Bun version, and finally version 1 when neither is available.

Changes:

  • Prefer an exact stable Bun version from packageManager.
  • Normalize the installed Bun version and provide a safe fallback.
  • Add tests covering pinned, installed, and missing Bun scenarios.
File Description
test/​gdf.test.js Adds tests covering Bun version selection for project pins, installed Bun versions, and missing local Bun.
gdf.js Implements Bun version precedence with a safe fallback for generated Dockerfile base images.

Review effort: Lite

Comment thread test/gdf.test.js Resolved
@tomr-fly
tomr-fly marked this pull request as ready for review November 29, 2026 19:16
@tomr-fly
tomr-fly merged commit aaa86cf into main Nov 29, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bun Dockerfiles can use an empty base image tag

2 participants