Nodevisor Docs
Packages

@nodevisor/builder

Abstract image builder interface for building and pushing container images.

Install

npm install @nodevisor/builder

Defines the abstract Builder class that all image builder implementations extend. You typically use concrete builders like DockerBuilder or NodeBuilder from @nodevisor/docker.


Builder (Abstract)

import Builder from '@nodevisor/builder';

// Builder is abstract — use concrete implementations

Configuration

new Builder({
  arch: 'amd64',            // Target architecture: 'amd64' | 'arm64'
  context: './apps/api',     // Build context path
  args: { NODE_ENV: 'production' }, // Build arguments
  tags: ['latest', 'v1.0'], // Image tags
});

Abstract Method

build(image, registry, config)

Build and optionally push an image. Returns an array of built tags.

const tags = await builder.build('myapp', registry, {
  push: true,
  context: './apps/api',
  labels: { version: '1.0' },
});

Implementations

ClassPackageDescription
DockerBuilder@nodevisor/dockerBuilds from an existing Dockerfile
NodeBuilder@nodevisor/dockerMulti-stage Node.js builder (generates Dockerfile)

DockerBuilder

import { DockerBuilder } from '@nodevisor/docker';

const builder = new DockerBuilder({
  dockerfilePath: './Dockerfile',
  context: '.',
  tags: ['latest'],
});

NodeBuilder

Generates an optimized multi-stage Dockerfile for Node.js apps:

import { NodeBuilder } from '@nodevisor/docker';

const builder = new NodeBuilder({
  context: './apps/api',
  tags: ['latest'],
  arch: 'amd64',
});

On this page