Sign inSign up
nodejs logo

ragedunicorn/nodejs

By ragedunicorn

•Updated 18 days ago

Public repository for ragedunicorn docker nodejs images

Image
Languages & frameworks
Developer tools
0

401

ragedunicorn/nodejs repository overview

⁠Node.js Alpine Docker Image

Docker Node.js

A minimal Node.js image on Alpine Linux, shipping Alpine's Node.js LTS package and npm pinned to exact versions.

⁠Quick Start

# Pull latest version
docker pull ragedunicorn/nodejs:latest

# Or pull specific version (see the Tags tab for the available versions)
docker pull ragedunicorn/nodejs:<node-major>-alpine<alpine-version>-<build>

# Run Node.js interactively (REPL)
docker run -it --rm ragedunicorn/nodejs:latest

# Run a Node.js script
docker run -v $(pwd):/app ragedunicorn/nodejs:latest script.js

On Windows, use the PowerShell form - ${PWD} with braces and the colon inside the quotes (without braces PowerShell parses $PWD: as a scope-qualified variable, as in $env:PATH, and rejects the argument):

# Run a Node.js script in the current directory
docker run -v "${PWD}:/app" ragedunicorn/nodejs:latest script.js

⁠Features

  • 🚀 Small footprint: compact runtime image built on Alpine Linux
  • 🟢 Node.js LTS: pinned Alpine package, reproducible builds
  • 📦 npm included: separately pinned npm for package management
  • 🔒 Security: non-root user, minimal attack surface
  • 🏗️ Multi-platform: supports linux/amd64 and linux/arm64
  • 🎯 Customizable: install only what you need

⁠Usage Examples

Examples that mount the current directory have a PowerShell variant below the bash one. Examples without a mount run unchanged in PowerShell.

⁠Run a Node.js script
docker run -v $(pwd):/app ragedunicorn/nodejs:latest script.js

PowerShell:

docker run -v "${PWD}:/app" ragedunicorn/nodejs:latest script.js
⁠Interactive Node.js shell (REPL)
docker run -it --rm ragedunicorn/nodejs:latest
⁠Execute JavaScript code
docker run --rm ragedunicorn/nodejs:latest -e "console.log('Hello, World!')"
⁠Install packages and run commands
# Install dependencies and run a script
docker run --rm -v $(pwd):/app --entrypoint sh ragedunicorn/nodejs:latest -c "npm install && node script.js"

# Install and run the project test suite
docker run --rm -v $(pwd):/app --entrypoint sh ragedunicorn/nodejs:latest -c "npm install && npm test"

PowerShell (single quotes keep && inside the container's sh):

# Install dependencies and run a script
docker run --rm -v "${PWD}:/app" --entrypoint sh ragedunicorn/nodejs:latest -c 'npm install && node script.js'

# Install and run the project test suite
docker run --rm -v "${PWD}:/app" --entrypoint sh ragedunicorn/nodejs:latest -c 'npm install && npm test'
⁠Build a custom image
FROM ragedunicorn/nodejs:latest

# Install additional global packages
USER root
RUN npm install -g typescript
USER node

# Your custom configuration
WORKDIR /app
COPY --chown=node:node . .
RUN npm install
CMD ["app.js"]

⁠Tags

This image uses semantic versioning that includes all component versions:

Format: {nodejs_major_version}-alpine{alpine_version}-{build_number}

⁠Version Examples

X is the Node.js major version, A.B.C the Alpine version:

  • X-alpineA.B.C-1 - Node.js X on Alpine A.B.C, first build
  • X-alpineA.B.C-2 - Rebuild of same versions (bug fixes, security patches)
  • X-alpineA.B.D-1 - Alpine Linux patch update
  • X - Most recent build of Node.js X
  • latest - Most recent stable release

The available versions are listed in the Tags tab⁠.

The pinned Node.js and npm package versions are fixed per release and tracked by automated dependency management. When updates are available, new releases are created with appropriate version tags.

⁠Working Directory

The default working directory is /app. Mount your code here:

docker run -v $(pwd):/app ragedunicorn/nodejs:latest your_script.js

PowerShell:

docker run -v "${PWD}:/app" ragedunicorn/nodejs:latest your_script.js

⁠License

MIT License - See GitHub repository⁠ for details.

Tag summary

Content type

Image

Digest

sha256:425b639d2…

Size

30.7 MB

Last updated

18 days ago

docker pull ragedunicorn/nodejs