Introducing a new way to review your PRs.

Read the announcement

frappe / frappe_docker

Docker environment for developing, deploying, and running Frappe applications (ERPNext and custom apps) in production and development

View on GitHub

15 documents · Updated Nov 23, 2026

docs / container-image-builds

Container image builds

This repository defines four image construction paths for Frappe-based systems. Bench supports development work. Production creates the standard core image family. Layered and custom paths add selected applications while sharing or controlling the core runtime. A shared build configuration keeps these paths aligned with their versioned artifacts.

Image construction paths

The image paths serve different points in the development and deployment lifecycle. Choose a path based on whether you need a development tool image, the standard Frappe and ERPNext image, published shared layers, or direct control of the build inputs.

PathMain resultBest fit
BenchA development environment with the Bench command-line toolLocal development, debugging, and Bench work
ProductionA core image family for Frappe and ERPNextStandard core releases and quick starts
LayeredAn app image built on published base and build imagesFast builds with selected extra apps
CustomAn app image built from a plain Python baseControlled builds with selected apps and tool versions

The detailed variant rules are in Image variant definitions. The CI handoff between core images and downstream app images is in Image build and publish automation.

Bench image

The Bench image provides the tools and supporting packages needed to create and work with a Frappe bench. It is a development environment rather than the normal application runtime image. Its build also checks that the main development commands work in an interactive shell. The image supports current and previous Python and Node release lines so development work can cover more than one supported runtime. (images/bench/Dockerfile)

The image supports both amd64 and arm64 publication. The scheduled Bench workflow builds and tests it before it publishes the image outside pull requests. (.github/workflows/core-build-bench.yml)

References: images/…/Dockerfile• L1-12 images/…/Dockerfile• L104-132 images/…/Dockerfile• L141-178 .github/…/core-build-bench.yml• L18-59

Production image family

The production path creates three related artifacts from one build definition. base supplies the shared runtime. build adds tools needed to build applications. erpnext carries the built Frappe and ERPNext bench for normal use. This split lets later image paths reuse common layers without rebuilding the full core image. (images/production/Containerfile)

The production path installs Frappe and ERPNext from selected repositories and branches. It is the standard core release path rather than the flexible path for arbitrary applications. Its shared runtime includes the services and tools needed by the application image, including web serving, database clients, browser support, and asset generation. (images/production/Containerfile)

References: images/…/Containerfile• L1-15 images/…/Containerfile• L95-150 images/…/Containerfile• L150-181

Layered application image

The layered path adds an application to already published base and build images. The application set comes from an apps.json input, so a downstream project can build its image without rebuilding the shared runtime and build layers. (images/layered/Containerfile)

This path is the standard downstream route when the required Frappe and build versions already exist in a registry. The final image follows the same bench, site, log, entrypoint, and asset behavior as the production application image. (images/layered/Containerfile)

References: images/…/Containerfile• L1-32 images/…/Containerfile• L34-63

Custom application image

The custom path builds the common runtime and application content in one definition. It accepts an optional app list and gives the builder direct control over the Python and Node versions used for the image. The image also enables package tools needed by applications that use more than one JavaScript package workflow. (images/custom/Containerfile)

This path is useful when a project needs a fixed app set but cannot rely on a matching published base and build pair. Its final application stage follows the same runtime contract as the layered and production paths. (images/custom/Containerfile)

References: images/…/Containerfile• L1-21 images/…/Containerfile• L102-161 images/…/Containerfile• L161-190

Build artifact coordination

The Buildx Bake file is the central map for the core artifacts. It supplies common repository and version inputs, selects each build definition, and assigns tags that other builds can use.

Core target graph

The default group builds the complete core family. The base-images group builds only the shared base and build artifacts. That is the set needed by downstream layered images and is also published to GHCR.

The diagram shows how one versioned core build produces both a ready application image and reusable inputs for later app builds.

flowchart LR
    V[Repository and version inputs] --> B[docker-bake.hcl]
    B --> Bench[bench]
    B --> Base[base]
    B --> Build[build]
    B --> ERP[erpnext]
    Base --> Layered[layered app image]
    Build --> Layered
    Apps[apps.json] --> Layered

The Bake targets use images/bench/Dockerfile for Bench and images/production/Containerfile for the core family. The layered and custom paths remain separate entry points because they have different source-image and app-selection needs. (docker-bake.hcl)

References: docker-bake.hcl• L39-67 docker-bake.hcl• L83-117 images/…/Containerfile• L1-4 images/…/Containerfile• L1-5

Version and tag inputs

The build configuration passes the selected Frappe and ERPNext repositories and refs into the core image family. It also passes the Python and Node versions that define the language runtime for that build. The registry prefix controls where the resulting tags point. (docker-bake.hcl)

Tags preserve the selected release or development line and add useful aliases for development and major releases. Downstream builds must use a frappe_ref that names the same shared base and build version family. (docker-bake.hcl, .github/workflows/app-build-image.yml)

References: docker-bake.hcl• L4-37 docker-bake.hcl• L69-92 docker-bake.hcl• L95-117 .github/…/app-build-image.yml• L18-34

Core and app handoff

Core image automation first resolves source versions and builds the core artifacts in a local registry. It tests those artifacts before publication. Publication sends the application image and shared images to their registries. A downstream app workflow then consumes the published base and build pair, installs its app, and optionally pushes a final image.

The two stages form one artifact contract: core automation provides versioned shared inputs, while app automation adds project-specific content.

The diagram shows how core publication supplies the shared images that a downstream app build needs.

sequenceDiagram
    participant Core as Core pipeline
    participant Registry as Image registry
    participant App as App pipeline
    Core->>Core: Resolve versions
    Core->>Core: Build and test core images
    Core->>Registry: Publish erpnext, base, and build
    App->>Registry: Read matching base and build
    App->>App: Add selected app
    App->>Registry: Publish final app image when enabled

The reusable core workflows separate testing from publication. The reusable app workflow creates the app list from the requested repository and ref, then builds the layered path for the requested platform set. (.github/workflows/core-build-test-images.yml, .github/workflows/core-publish-images.yml, .github/workflows/app-build-image.yml)

References: .github/…/core-build-test-images.yml• L33-108 .github/…/core-publish-images.yml• L36-92 .github/…/app-build-image.yml• L104-189

The image paths and their runtime differences are described in Image variant definitions. The triggers, version resolution, registry handoff, and downstream app flow are described in Image build and publish automation.

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the base and build tag contract aligned between docker-bake.hcl, core publication, and the frappe_ref consumed by layered app builds.
  • Keep image path changes aligned with the workflow path filters. A changed Containerfile can otherwise avoid the intended CI pipeline.
  • If the app-list format or app ref rules change, update both the app workflow that creates apps.json and the layered and custom build paths that consume it.
  • If a runtime or build version changes, update the core workflow inputs and the downstream version values that select shared images.
  • If platform support changes, review architecture setup, image publication platforms, and architecture-specific package sources together.

Important failure modes

TriggerConsequenceGuard
A layered build uses a frappe_ref for which base or build was not publishedThe app image cannot resolve its shared source imagesPublish the matching core family before starting the downstream app build
apps.json names a repository or ref that does not contain the requested app directoryThe smoke check fails or the final image lacks the expected appKeep app_name, app_repo, and app_ref as one tested input set
Core image tests pass but publication is skipped for a non-release contextLocal CI images exist only for that run and cannot serve later app buildsTreat pull request builds as validation only and use a publish-capable run for shared artifacts
A target is built for an unsupported architecture or package sourceThe image build fails during an architecture-specific dependency stepKeep QEMU, platform lists, and architecture-aware package versions in sync
A custom or layered build receives no valid app listThe image contains the framework base but not the intended extra applicationValidate the generated app-list input before relying on the final image

Key files

FileWhy to read it
docker-bake.hclDefines the core target graph, shared inputs, registry prefix, and tag rules
images/bench/DockerfileShows the development-oriented Bench image path and its test target
images/production/ContainerfileShows how the reusable core artifacts and the standard ERPNext image relate
images/layered/ContainerfileShows the downstream path that combines published shared images with selected apps
images/custom/ContainerfileShows the self-contained path for controlled runtime and app builds
.github/…/core-build-test-images.ymlConnects version resolution, multi-architecture builds, and image tests
.github/…/core-publish-images.ymlConnects tested core artifacts to Docker Hub and GHCR publication
.github/…/app-build-image.ymlConnects a downstream app request to an optional final image publication