nextjs - ✅(Solved) Fix Docs: Dockerfile.bun no longer builds. [1 pull requests, 3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#87722Fetched 2026-04-08 02:06:23
View on GitHub
Comments
3
Participants
3
Timeline
10
Reactions
0
Author
Timeline (top)
commented ×3cross-referenced ×2closed ×1issue_type_added ×1

Fix Action

Fixed

PR fix notes

PR #87443: fix: Change Dockerfile.bun to use group/useradd instead of addgroup/user

Description (problem / solution / changelog)

<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change -->

(sorry for my bad english)

What?

Change /examples/with-docker/Dockerfile.bun to use group/useradd instead of addgroup/user.

Why?

Currently, the docker build command results in an error /bin/sh: 1: addgroup: not found. (related issue: oven-sh/bun#25441)

How?

I changed the addgroup/user command to user/groupadd as a workaround. #

fixes #87722.

Changed files

  • examples/with-docker/Dockerfile.bun (modified, +2/-2)
RAW_BUFFERClick to expand / collapse

What is the documentation issue?

The base bun image of Dockerfile.bun now defaults to a Debian-based build instead of an Alpine-based build, which breaks l40-41.

In order to be compatible for debian, the commands need to change to groupadd and useradd respectively.

Is there any context that might help us understand?

Either the dockerfile has to lock to the canary-alpine image, or we have to lock to debian and accept that the Dockerfile has to be edited.

Does the docs page already exist? Please link to it.

https://github.com/vercel/next.js/tree/canary/examples/with-docker

extent analysis

TL;DR

To fix the issue, update the Dockerfile to use groupadd and useradd commands for Debian-based builds or lock the base image to canary-alpine to maintain compatibility with Alpine-based builds.

Guidance

  • Update lines 40-41 of the Dockerfile to use groupadd and useradd instead of the current commands to support Debian-based builds.
  • Alternatively, consider locking the base image to canary-alpine to avoid modifying the Dockerfile and maintain compatibility with Alpine-based builds.
  • Verify the changes by rebuilding the Docker image and checking that the issue is resolved.
  • If choosing to lock to debian, ensure that all dependencies and commands in the Dockerfile are compatible with Debian-based systems.

Example

# Before
RUN addgroup -g 1001 node && adduser -u 1001 -G node -s /bin/sh -D node

# After (for Debian-based builds)
RUN groupadd -g 1001 node && useradd -u 1001 -g 1001 -s /bin/sh -D node

Notes

The solution depends on whether the project should support Debian-based builds or stick with Alpine-based builds. Each approach has its trade-offs in terms of image size, compatibility, and maintenance.

Recommendation

Apply workaround by updating the Dockerfile commands to support Debian-based builds, as this allows for flexibility in choosing the base image without locking into a specific version or distribution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - ✅(Solved) Fix Docs: Dockerfile.bun no longer builds. [1 pull requests, 3 comments, 3 participants]