Skip to content

docker: Images >1.2GB due to missing .dockerignore and multi-stage build #821

Description

@Cripto5588

[BUG] Docker images >1.2GB due to missing .dockerignore and multi-stage builds

Current Problem

The dockerfiles/avail-node.Dockerfile builds images 1.24GB+, making deploys impractical:

Local benchmark:

docker build -f dockerfiles/avail-node.Dockerfile -t avail:current .
# => 1.24GB, 8 layers, 6min+ build time

Root causes:

  • No .dockerignore: Copies entire repo (.git/, target/, benches/) → 800MB+ bloat
  • No multi-stage: Full Rust toolchain (200+MB) leaks into runtime image
  • Unoptimized layers: 8+ layers vs typical Substrate 3-4 layers

Impact:

  • Slow CI/CD pipelines (6min+ builds)
  • High GHCR/DockerHub storage costs
  • Poor node operator DX (slow deploys)
  • Larger attack surface (toolchain binaries)

Substrate Comparison

Production Substrate/Polkadot nodes: ~350-450MB. Avail is 3x larger than industry standard.

Expected behavior: Lean runtime images (<500MB) following Substrate best practices.

@avail-node-team - Confirming this needs attention?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions