Node.js dev container with multiple versions, package managers, and build tools for JS/TS projects.
443
Full-featured Node.js development container with multiple versions, package managers, and essential build tools for JavaScript/TypeScript projects.
| Version | Status |
|---|---|
| 22 | Default |
| 24 | Available |
| 26 | Available |
| Manager | Version | Notes |
|---|---|---|
| npm | 12.0.1 | Upgraded to latest |
| pnpm | latest | Via corepack |
| yarn | latest | Via corepack |
| bun | 1.3.14 | Pinned, official installer |
# Interactive shell with project mounted
docker run -it --rm \
-v $(pwd)/my-project:/app \
-p 3000:3000 \
nodejs-dev:<version> bash
# Run specific Node version
docker run -it --rm \
-v $(pwd)/my-project:/app \
nodejs-dev:<version> fnm use 22 npm test
# Inside container
fnm use 24
node -v
# On run
docker run -it --rm nodejs-dev:<version> bash -c "fnm use 24 && node -v"
# Development server
docker run --rm -v $(pwd)/my-project:/app -p 3000:3000 nodejs-dev:<version> npm run dev
# Install dependencies
docker run --rm -v $(pwd)/my-project:/app nodejs-dev:<version> pnpm install
# Run tests
docker run --rm -v $(pwd)/my-project:/app nodejs-dev:<version> npm test
# Build project
docker run --rm -v $(pwd)/my-project:/app nodejs-dev:<version> npm run build
# Create project folder
mkdir -p my-project
# Start container and init
docker run -it --rm -v $(pwd)/my-project:/app nodejs-dev:<version> bash
# Inside container
npm init -y
npm install express
| Port | Common Use |
|---|---|
| 3000 | Express / Next.js |
| 5173 | Vite dev server |
| 8080 | General purpose |
| Variable | Value | Purpose |
|---|---|---|
TZ | Etc/UTC | Default timezone |
FNM_NODE_DIST_MIRROR | https://unofficial-builds.nodejs.org/download/release | musl Node.js builds |
/
├── app/ # Working directory (mount your project here)
├── root/.fnm/ # fnm versions
└── root/.bun/ # bun runtime
Security Fixes:
apk upgrade --no-cache to runtime stage for latest security patchesSecurity Fixes:
alpine:3.23.5 to alpine:edge to get latest patched packagesBreaking Changes:
ubuntu:24.04 to alpine:3.23.5yq removed (not in Alpine default repos)cmake removed (not in Alpine repos, use cmake from build-base if needed)unzip, wget, jq, tar, nano, coreutils removed from runtime (use curl, busybox, and vim instead)Security Fixes:
pip from runtime (no setuptools/wheel CVEs)tar (busybox provides), nano (use vim), coreutils (busybox provides) from runtimePerformance:
Breaking Changes:
debian:bookworm-slim to ubuntu:24.04Security Fixes:
apt-get upgrade -y to patch all available OS-level CVEssetuptools 68.1.2 -> 83.0.0 (fixes CVE-2025-47273, CVE-2024-6345)wheel 0.42.0 -> 0.47.0 (fixes CVE-2026-24049)--skip-shell (prevents shell RC modification during build)v1.3.14 (reproducible builds)npm cache clean --force after global installs (reduces image size)apt-get purge --auto-remove and cleanup of /tmp/* and /var/tmp/*Remaining Vulnerabilities (unfixable at container level):
debian:bookworm-slimMIT
Content type
Image
Digest
sha256:9778d5634…
Size
271.2 MB
Last updated
2 months ago
docker pull yanwit/nodejs-dev