Documentsdify
Docker Image Publishing
Docker Image Publishing
Type
Topic
Status
Published
Created
Jul 8, 2026
Updated
Jul 15, 2026
Updated by
Dosu Bot

Docker Image Publishing#

Dify publishes multi-platform Docker images for four services via a single GitHub Actions workflow: .github/workflows/build-push.yml. Images are built separately for linux/amd64 and linux/arm64, then combined into a manifest list so Docker can auto-select the right platform at pull time.


Trigger Conditions#

The workflow fires on pushes to :

  • main, deploy/**, build/**, hotfix/**
  • release/e-*
  • Any git tag (*)

Concurrent runs for the same ref are cancelled (cancel-in-progress: true) . The entire build and create-manifest job chain only runs on the canonical langgenius/dify repository — forks get a lightweight AMD64-only validation build instead .


Images Published#

Four images are published, each overridable via a repository variable :

ImageDefault nameDockerfile
API backendlanggenius/dify-apiapi/Dockerfile
Web frontendlanggenius/dify-webweb/Dockerfile
Agent backendlanggenius/dify-agent-backenddify-agent/Dockerfile
Agent local sandboxlanggenius/dify-agent-local-sandboxdify-agent-runtime/docker/Dockerfile

Build Strategy#

Each image is built in a parallel matrix — one job per service per platform (8 build jobs total) — using Depot runners (depot-ubuntu-24.04-4) for faster layer caching .

Key build details:

  • Build context: All images use {{defaultContext}} (repo root) except dify-agent-local-sandbox, which scopes to {{defaultContext}}:dify-agent-runtime .
  • Commit SHA baked in: COMMIT_SHA is passed as a build arg from the OCI revision label .
  • Push by digest: Each platform image is pushed without a tag (push-by-digest=true) and its digest is saved as a GitHub Actions artifact (digests-<context>-<platform>) for the merge step .

Tag Strategy#

Tags are applied only at the manifest creation stage, not during the per-platform build. The docker/metadata-action generates four tag types :

TagWhen applied
latestOn git tags that do not contain - (stable releases only)
<branch-name>On branch pushes
<full-commit-SHA>Always (40-char hex, no prefix/suffix)
<tag-name>On git tag pushes (e.g. 1.5.0)

Manifest Creation#

After all 8 platform builds succeed, the create-manifest job runs once per image :

  1. Downloads the platform digests uploaded by the build jobs.
  2. Calls docker buildx imagetools create with all generated tags and all digest references — this creates and pushes the multi-platform manifest list in one command .
  3. Runs docker buildx imagetools inspect to verify the manifest .

The resulting manifest references both linux/amd64 and linux/arm64 layers under each tag, so a plain docker pull langgenius/dify-api:main will automatically pull the correct platform image.


Fork Builds#

On forks, a separate fork-build-validate job runs a local linux/amd64-only build (no push) for each service to validate the Dockerfiles without requiring Docker Hub credentials .