Ready to use Bun and Node.js Docker Images
1.8K
Bun tooling and the official Node.js runtime in one container image. Use Bun to install dependencies, run TypeScript, and build your application, then run the resulting JavaScript with Node.js.
fusionaxi/bun-nodelinux/amd64 and linux/arm64slimbun (UID/GID 1001:1001)/appSource code · Dockerfile · Available tags · Report an issue
docker pull fusionaxi/bun-node:latest
docker run --rm fusionaxi/bun-node:latest bun --version
docker run --rm fusionaxi/bun-node:latest node --version
Run a local TypeScript file with Bun:
docker run --rm -v "$PWD:/app" fusionaxi/bun-node:slim ./main.ts
Install project dependencies with Bun:
docker run --rm -v "$PWD:/app" fusionaxi/bun-node:slim bun install
Bind-mounted directories must allow UID 1001 to write when installing dependencies or producing build output.
| Variant | Runtime base | Included tooling |
|---|---|---|
slim | Official Node.js Debian Bookworm slim | Bun, bunx, Node.js, Tini |
debian | Official Node.js Debian Bookworm | Bun, bunx, Node.js, Tini |
alpine | Official Node.js Alpine | Bun's musl build, bunx, Node.js, Tini |
alpine-git | Official Node.js Alpine | Alpine tooling plus Git, Git LFS, OpenSSH client |
The alpine-git variant initializes Git LFS at the system level. Choose a Debian variant when your application requires a glibc-based environment.
| Tag pattern | Meaning |
|---|---|
latest | Newest supported Node.js LTS, slim variant |
<variant> | Newest supported Node.js LTS with the selected variant |
<node-major>-<variant> | Latest selected patch in a supported Node.js major |
<node-version>-<variant> | Exact Node.js version with the release's selected stable Bun |
<bun-version>-<node-version>-<variant> | Exact Bun and Node.js versions with the selected variant |
Version placeholders use numeric versions without a leading v. Releases select the latest stable Bun and the newest Node.js patch in each supported Current, Active LTS, and Maintenance LTS major. Bun canary and prereleases are excluded.
Versioned tags can be rebuilt to refresh their operating system packages. Pin a published digest (fusionaxi/bun-node@sha256:...) when you need an immutable reference. Consult the available tags page for published versions.
For a project with main.ts, use this Dockerfile:
FROM fusionaxi/bun-node:slim
COPY --chown=bun:bun main.ts /app/main.ts
RUN bun build main.ts --target=node --outdir=dist
CMD ["node", "dist/main.js"]
docker build -t my-bun-node-app .
docker run --rm my-bun-node-app
For projects with dependencies, copy package.json and bun.lock, run bun install --frozen-lockfile, and then copy and build the application source. See the Node.js example.
The default command is bun --help. Explicit executable commands such as bun, node, and sh run directly. Flag-only arguments and non-executable script paths are passed to Bun, so docker run --rm fusionaxi/bun-node:slim --version prints the Bun version.
Tini runs as the init process, and the entrypoint executes the selected command to preserve signals and exit codes. Container startup makes no telemetry requests.
Global Bun packages install under /home/bun/.bun, with executables in /home/bun/.bun/bin on PATH. The application directory and Bun installation directory are writable by bun. Bun's runtime transpiler cache is disabled through BUN_RUNTIME_TRANSPILER_CACHE_PATH=0.
Use COPY --chown=bun:bun for application files. When adding system packages in a derived image, switch to USER root for installation and back to USER bun afterward.
Content type
Image
Digest
sha256:5ac649042…
Size
131.5 MB
Last updated
about 23 hours ago
docker pull fusionaxi/bun-node