Skip to main content

Overview

Dokrypt orchestrates Docker containers for every chain and service. Understanding the container architecture helps with debugging, customization, and advanced configurations.

Container Architecture

When you run dokrypt up, Dokrypt:
  1. Creates a Docker networkdokrypt-{project-name} for inter-container communication
  2. Starts chain containers — Each chain runs in its own container (Anvil, Hardhat, or Geth)
  3. Starts service containers — IPFS, explorers, oracles, etc. in dependency order
  4. Runs health checks — Waits for all containers to report healthy
  5. Saves state — Container IDs and ports saved to ~/.dokrypt/state/

Container Runtime

Dokrypt supports Docker and Podman:
Or via CLI:

Runtime Requirements

Docker Images

Chain Images

Service Images

Running Dokrypt in Docker

Dokrypt itself can run as a Docker container:
The Docker socket mount is required so Dokrypt can manage sibling containers.

Dockerfile.cli

Custom Service Images

Use type: custom to run any Docker image:

Build from Dockerfile

Container Labels

Dokrypt labels all containers with:
You can list Dokrypt containers:

Networking

Environment Network

All containers share a Docker bridge network named dokrypt-{project}. Containers can reach each other by service name:
From the host, use localhost with the mapped ports:

Volumes

Services can mount volumes for persistent data:
Remove volumes when stopping:

Debugging Containers

View logs

Execute commands inside a container

Inspect container directly with Docker

Resource Limits

Container resource limits can be set through the container runtime configuration. The ContainerConfig supports: These are configured programmatically through the container runtime interface and can be set via custom service configurations.

Cleanup