Putnami
DocsGitHub

Licensed under FSL-1.1-MIT

Getting Started
Concepts
How To
Build A Web App
Build An Api Service
Share Code Between Projects
Configure Your App
Add Persistence
Add Authentication
Add Background Jobs
Principles
Tooling & Workspace
Workspace Overview
Cli
Jobs & Commands
SDK
Error Handling
Extensions
Typescript
Go
Python
Docker
Ci
Frameworks
Typescript
OverviewWebReact RoutingForms And ActionsStatic FilesApiErrors And ResponsesConfigurationLoggingHttp And MiddlewareDependency InjectionPlugins And LifecycleSessionsAuthPersistenceEventsStorageCachingWebsocketsTestingHealth ChecksTelemetryProto GrpcSmart Client
Go
OverviewHttpDependency InjectionPlugins And LifecycleConfigurationSecurityPersistenceErrorsEventsStorageCachingLoggingTelemetryGrpcService ClientsValidationOpenapiTesting
Platform
  1. DocsSeparator
  2. Tooling & WorkspaceSeparator
  3. Docker

Docker Support

Docker build and publish is handled by each language extension as part of its publish job. There is no standalone Docker extension — each technology plugin knows how to generate a Dockerfile and push images for its own project type.

How it works

When you run putnami publish with Docker options, the language extension:

  1. Generates a Dockerfile using its built-in Docker builder (or uses a custom Dockerfile in the project root).
  2. Builds the image with docker build.
  3. Tags and pushes image(s) to the configured registry.

External tools

  • Docker

Per-extension Docker builders

Extension Base image Strategy
@putnami/typescript oven/bun:slim Copies pre-compiled standalone bundle into container
@putnami/go gcr.io/distroless/static:nonroot Copies statically-linked binary
@putnami/python ghcr.io/astral-sh/uv:python3.12-bookworm-slim Uses uv for dependency resolution

Each builder implements the DockerImageBuilder interface from @putnami/sdk.

Publish options

Add these flags to putnami publish to enable Docker publishing:

  • --docker-registry <registry> — Docker registry URL (or set DOCKER_REGISTRY env var)
  • --docker-tag <tag> — Override image tag
  • --platform <platform> — Target platform (default: linux/amd64)
  • --workspace-builder-image <image> — Workspace builder image for CI multi-stage builds
  • --port <number> — Container port to expose (default: 3000)
  • --stable — Publish stable version (strips pre-release suffix, tags as latest)

Examples

# Publish with Docker image
putnami publish my-app --docker-registry ghcr.io/myorg

# Stable publish
putnami publish my-app --docker-registry ghcr.io/myorg --stable

# Dry run to preview tags
putnami publish my-app --docker-registry ghcr.io/myorg --dry-run

Project configuration

Enable the docker publish channel in your project's .putnamirc.json:

{
  "publish": ["npm", "docker"]
}

Next steps

  • Previous: Python
  • Next: CI

On this page

  • Docker Support
  • How it works
  • External tools
  • Per-extension Docker builders
  • Publish options
  • Examples
  • Project configuration
  • Next steps