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 rundokrypt up, Dokrypt:
- Creates a Docker network —
dokrypt-{project-name}for inter-container communication - Starts chain containers — Each chain runs in its own container (Anvil, Hardhat, or Geth)
- Starts service containers — IPFS, explorers, oracles, etc. in dependency order
- Runs health checks — Waits for all containers to report healthy
- Saves state — Container IDs and ports saved to
~/.dokrypt/state/
Container Runtime
Dokrypt supports Docker and Podman:Runtime Requirements
| Runtime | Minimum Version | API Version |
|---|---|---|
| Docker | 20.10+ | 1.41+ |
| Podman | 4.0+ | — |
Docker Images
Chain Images
| Engine | Image |
|---|---|
| Anvil | ghcr.io/foundry-rs/foundry:latest |
| Hardhat | node:20-alpine (runs npx hardhat) |
| Geth | ethereum/client-go:stable |
Service Images
| Service | Image |
|---|---|
| IPFS | ipfs/kubo:latest |
| Blockscout | blockscout/blockscout:latest |
| Subgraph | graphprotocol/graph-node:latest |
Running Dokrypt in Docker
Dokrypt itself can run as a Docker container:Dockerfile.cli
Custom Service Images
Usetype: custom to run any Docker image:
Build from Dockerfile
Container Labels
Dokrypt labels all containers with:Networking
Environment Network
All containers share a Docker bridge network nameddokrypt-{project}. Containers can reach each other by service name:
localhost with the mapped ports:
Volumes
Services can mount volumes for persistent data: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. TheContainerConfig supports:
| Setting | Description |
|---|---|
MemoryLimit | Maximum memory (e.g., 512m, 2g) |
CPULimit | CPU cores (e.g., 1.5 = 1.5 cores) |
ReadOnly | Read-only root filesystem |
CapDrop | Dropped Linux capabilities |