docker field in your variant configuration controls how Docker images are built and pushed.
Schema
Configuration Fields
Dockerfile
Path to Dockerfile relative to the app context.Default behavior:
latestvariant:Dockerfile- Other variants:
Dockerfile.{variantName}
Images
The
{name} placeholder is replaced with the app name from meta.json.Tags
Platforms
Target platforms for multi-arch builds.Supported platforms:
linux/amd64- x86_64 (Intel/AMD)linux/arm64- ARM 64-bit (Apple Silicon, AWS Graviton)linux/arm/v7- ARM 32-bit v7linux/arm/v6- ARM 32-bit v6linux/386- x86 32-bitlinux/ppc64le- PowerPC 64-bitlinux/s390x- IBM Z
Labels
Custom Docker labels following OCI Image Format.Auto-generated labels:
org.opencontainers.image.descriptionorg.opencontainers.image.licensesorg.opencontainers.image.revisionorg.opencontainers.image.sourceorg.opencontainers.image.titleorg.opencontainers.image.urlorg.opencontainers.image.version
Build Arguments
Build-time variables passed to Docker.Use in Dockerfile:
Secrets
Build secrets for sensitive data (requires Docker BuildKit).Use in Dockerfile:
Push
Push the built image to registries.Automatically disabled for:
- Test apps (
test/directory) - Local development (ACT mode)
Load
Load the built image into local Docker daemon.
push and load are mutually exclusive when using multiple platforms.Outputs
Custom output configuration for Docker build.
Cache
Docker build cache configuration.
By default, Apps Image uses GitHub Actions cache (
type=gha) automatically.Examples
Minimal Configuration
Custom Tags and Platforms
apps/cobalt/meta.json
Development Variant
apps/cobalt/meta.json
Single Platform Build
apps/readest/meta.json
Custom Images and Labels
apps/haitang/meta.json
Multi-Registry Push
docker.io/myuser/app:latestdocker.io/myuser/app:1.2.3ghcr.io/myorg/app:latestghcr.io/myorg/app:1.2.3registry.example.com/app:latestregistry.example.com/app:1.2.3
Build Scripts
Apps Image supports pre and post build scripts:Pre-build Script
Script executed before Docker build.Naming:
latestvariant:pre.sh- Other variants:
pre.{variantName}.sh
apps/myapp/pre.sh
Post-build Script
Script executed after Docker build.Naming:
latestvariant:post.sh- Other variants:
post.{variantName}.sh
apps/myapp/post.sh
Registry Authentication
Configure registry credentials in GitHub Secrets:- Docker Hub:
DOCKERHUB_USERNAME,DOCKERHUB_TOKEN - GHCR:
GITHUB_TOKEN(automatic) - Aliyun ACR:
ALI_ACR_REGISTRY,ALI_ACR_USERNAME,ALI_ACR_PASSWORD
Best Practices
-
Use semantic versioning tags:
-
Optimize platform selection:
- Use
linux/amd64only for faster builds during development - Add
linux/arm64for production (Apple Silicon, AWS Graviton)
- Use
-
Use build arguments for customization:
-
Add meaningful labels:
-
Separate dev and production variants:
Related
- Meta Schema - Complete configuration reference
- Placeholders - Template variables for tags
- Resolve Meta Action - Metadata resolution