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:
- Generates a Dockerfile using its built-in Docker builder (or uses a custom
Dockerfilein the project root). - Builds the image with
docker build. - Tags and pushes image(s) to the configured registry.
External tools
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 setDOCKER_REGISTRYenv 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 aslatest)
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-runProject configuration
Enable the docker publish channel in your project's .putnamirc.json:
{
"publish": ["npm", "docker"]
}