Skip to main content

Docker

Docker Configuration

Configuration options when using DxCore with Docker Buildx.

⚠️ Experimental: Docker support is experimental. APIs and behavior may change without notice.

Adapter Capabilities

The Docker adapter parses docker buildx bake --print JSON output. It extracts all targets and their relationships.

Field Available Description
Target name Yes Bake target name used as task ID
Dockerfile Yes Path to the Dockerfile
Context Yes Build context directory
Tags Yes Image tags
Dependencies Yes Cross-target contexts references
Cache config No Not extracted at plan time

Build System Flag

Pass -b docker to both dispatcher and agent:

# Dispatcher
docker buildx bake --print | dxcore dispatch \
-c $URL -s $SESSION -t $TOKEN -b docker
# Agent
dxcore agent \
-c $URL -a agent-1 -s $SESSION -t $TOKEN -b docker

Cross-Target Dependencies

Docker Buildx bake supports cross-target dependencies through the contexts field. For example, a target that depends on a base image target. DxCore parses these into proper DAG edges so dependent targets wait for their prerequisites.

Working Directory

Use -w to set the build context base path:

docker buildx bake --print | dxcore dispatch \
-c $URL -s $SESSION -t $TOKEN -b docker -w ./services

Cache Behavior

DxCore does not provide its own caching. For Docker builds, caching is handled by external systems — Docker BuildKit layer caching and registry-based cache sources (--cache-from/--cache-to). DxCore executes the docker buildx build commands as-is and is not involved in cache decisions.

Configure BuildKit cache options directly in your docker-bake.hcl or via environment variables. DxCore will pass them through unchanged.

Registry Authentication

Agents need registry access for --push. Set this up on your CI runners before starting the agent:

echo "$REGISTRY_TOKEN" | docker login ghcr.io -u "$REGISTRY_USER" --password-stdin
dxcore agent -c $URL -a agent-1 -s $SESSION -t $TOKEN -b docker

Tip

For multi-platform builds, configure your Buildx builder before starting agents. DxCore executes the docker buildx build commands as-is, so any builder configuration applies.

Next Steps