You have reached the beginning of time!

Introducing Distroless Docker Images for N|Solid

Smaller attack surface. Fewer unnecessary packages. Full N|Solid observability.

Container security is an essential part of running Node.js applications in production. For engineering and security teams, managing container vulnerabilities, reviewing CVE reports, and maintaining secure base images can introduce significant operational overhead.

Today, we're introducing Distroless Docker Images for N|Solid, designed to help teams reduce their container attack surface and simplify vulnerability management without sacrificing runtime visibility.

N|Solid distroless images are available for Node.js 22 (Jod), 24 (Krypton), and 26 (Lithium), supporting both linux/amd64 and linux/arm64, with root and non-root variants.

Why distroless?

Traditional container images include operating system components that production applications often don't need: shells, package managers, command-line utilities, and additional system libraries.

Every additional component introduces something to maintain, patch, and potentially investigate when vulnerability scanners report a CVE.

Distroless images take a different approach. They include only the runtime and the essential system dependencies required to run your application.

For teams running N|Solid in production, this means:

  • Reduced attack surface: Removing unnecessary tools and packages limits the resources available to an attacker inside a compromised container.
  • Less vulnerability scanner noise: Fewer operating system packages can translate into fewer findings to investigate and remediate.
  • Smaller container images: Removing unnecessary components reduces image size, helping improve image pull times and registry storage efficiency.
  • Simplified compliance: Teams following hardened container security practices can adopt N|Solid without maintaining their own minimal base images.
  • Non-root execution: Dedicated non-root variants support the principle of least privilege.

Distroless images don't eliminate all vulnerabilities. Keeping your application dependencies, Node.js runtime, and container base images up to date remains essential.

What's new?

N|Solid now provides two distroless image variants for each supported Node.js release line.

Image variantExecution user
trixie-distrolessRoot
trixie-distroless-nonrootNon-root (UID 65532)

Both variants are built on Google's distroless/cc-debian13 base image, based on Debian 13 (Trixie), and support AMD64 and ARM64 architectures.

Like our other N|Solid Docker images, the distroless variants are:

  • Cryptographically signed using Sigstore Cosign.
  • Published with a Software Bill of Materials (SBOM) and build provenance attestations.
  • Smoke-tested on both supported architectures before release.
  • Built using base images pinned by digest.

Base image updates are tracked and incorporated into subsequent N|Solid releases.

Full N|Solid observability, without the unnecessary components

Reducing your container footprint shouldn't mean losing visibility into your applications.

Our distroless images include the same N|Solid runtime and built-in agent as our standard images, providing access to N|Solid Console capabilities, including:

  • Runtime performance metrics.
  • Application monitoring.
  • Distributed tracing.
  • CPU profiling.
  • Heap snapshots.

These capabilities are particularly valuable in distroless environments, where traditional shell-based debugging tools are unavailable.

You can connect your container to N|Solid Console using environment variables, just as you would with our standard images:

docker run --rm \
  -e NSOLID_SAAS="<your-saas-token>" \
  -e NSOLID_APPNAME="checkout-service" \
  -e NSOLID_TRACING_ENABLED=1 \
  -v "$PWD:/app:ro" \
  nodesource/nsolid:lithium-trixie-distroless-nonroot-latest /app/index.js

Your application can be monitored and diagnosed directly from N|Solid Console, without requiring a shell inside the running container.

Getting started with a multi-stage Docker build

Distroless images are designed to serve as the final runtime stage of a multi-stage Docker build.

Use a standard N|Solid image to install your application dependencies, then copy the application into the distroless runtime image.

# Build stage
FROM nodesource/nsolid:lithium-trixie-slim-latest AS build

WORKDIR /app

COPY package*.json ./
RUN npm ci --omit=dev

COPY . .

# Runtime stage
FROM nodesource/nsolid:lithium-trixie-distroless-nonroot-latest

WORKDIR /app

COPY --from=build /app /app

ENV NODE_ENV=production

EXPOSE 3000

CMD ["server.js"]

The final image contains your application, its production dependencies, the N|Solid runtime, and essential system libraries.

Since the image uses the nsolid binary as its entrypoint, you only need to specify your application's entry file in the CMD instruction.

For production deployments, we recommend pinning your base images to an exact version or digest to ensure reproducible builds.

Things to know before switching

Distroless containers introduce some differences compared to traditional Debian and Alpine-based images:

  • No shell: Commands such as docker exec -it <container> sh won't work. Use N|Solid diagnostics or ephemeral debug containers instead.
  • No package managers: npm, npx, and Yarn are not available in the final image. Install dependencies during the build stage.
  • Native add-ons: Build native dependencies using a compatible N|Solid image. Dependencies that require additional system libraries may need extra configuration or a standard slim image.
  • Health checks: Prefer orchestrator-managed HTTP probes over shell-based health checks that depend on tools such as curl.
  • Graceful shutdown: Ensure your application handles SIGTERM appropriately.
  • Non-root permissions: When using the non-root variant, ensure that any directories or mounted volumes requiring write access are accessible to UID 65532.

Distroless images are completely opt-in. Existing N|Solid Docker tags and deployments remain unchanged unless you explicitly choose to migrate to a distroless variant.

For additional configuration guidance, examples, and limitations, visit our Distroless Docker Images documentation.

Get started today

N|Solid distroless images are available for the following Node.js release lines:

Node.js 22 (Jod)

docker pull nodesource/nsolid:jod-trixie-distroless-nonroot-latest

Node.js 24 (Krypton)

docker pull nodesource/nsolid:krypton-trixie-distroless-nonroot-latest

Node.js 26 (Lithium)

docker pull nodesource/nsolid:lithium-trixie-distroless-nonroot-latest

Explore all available image variants and version-specific tags on Docker Hub.

Secure by design. Observable by default.

At NodeSource, we're committed to helping organizations run Node.js applications securely, reliably, and with the visibility they need in production.

With N|Solid distroless images, engineering and security teams can reduce unnecessary container components, simplify vulnerability management, and maintain the runtime observability they rely on.

Less in your container. More visibility into your application.

The NodeSource platform offers a high-definition view of the performance, security and behavior of Node.js applications and functions.

Start for Free