Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

Added

  • Initial release of Testcontainers OCaml
  • Core container lifecycle management
    • Container.start, Container.stop, Container.terminate
    • Container.with_container for automatic cleanup
    • Container exec, logs, and state inspection
  • Container request builder with fluent API
    • Port exposure and mapping
    • Environment variables
    • Volume mounts (bind, named, tmpfs)
    • Commands and entrypoints
    • Labels and names
  • Wait strategies
    • for_listening_port - Wait for TCP port
    • for_log - Wait for log message
    • for_log_regex - Wait for log pattern
    • for_http - Wait for HTTP endpoint
    • for_exec - Wait for command success
    • for_health_check - Wait for Docker health check
    • all and any combinators
    • Configurable timeouts and poll intervals
  • Docker network support
    • Network.create and Network.remove
    • Network.with_network for automatic cleanup
  • File operations
    • Container.copy_file_to - Copy file to container
    • Container.copy_file_from - Copy file from container
    • Container.copy_content_to - Copy string content to container
  • Pre-built modules
    • testcontainers-postgres - PostgreSQL
    • testcontainers-mysql - MySQL
    • testcontainers-mongo - MongoDB
    • testcontainers-redis - Redis
    • testcontainers-rabbitmq - RabbitMQ
    • testcontainers-kafka - Apache Kafka (KRaft mode)
    • testcontainers-elasticsearch - Elasticsearch
    • testcontainers-localstack - LocalStack (AWS emulation)
    • testcontainers-memcached - Memcached
    • testcontainers-mockserver - MockServer (HTTP mocking)
  • Container inspection features
    • Container.container_ip - Get container IP address
    • Container.container_ips - Get all container IPs (multi-network)
    • Container.network_aliases - Get network aliases
    • Container.gateway - Get gateway address
    • Container.inspect - Full container inspection
  • Log streaming
    • Container.follow_logs - Stream logs with callback
  • Directory copy
    • Container.copy_dir_to - Copy directory to container
  • Comprehensive test suite (85 tests)
  • Documentation with mdbook

Technical Details

  • Pure OCaml implementation using Unix sockets
  • Lwt-based async operations
  • Direct Docker Engine API communication (no CLI dependency)
  • Supports Docker API v1.43

Version History

v1.0.0 (Planned)

First stable release with:

  • All core features
  • Ten database/service modules
  • Complete documentation
  • CI/CD integration examples

Migration Guides

Upgrading to 1.0.0

This is the first release, no migration needed.


Compatibility

OCaml VersionStatus
5.2.xSupported
5.1.xSupported
5.0.xSupported
< 5.0Not supported
Docker VersionStatus
24.xTested
23.xShould work
20.x+Should work
PlatformStatus
LinuxFully supported
macOS (Docker Desktop)Fully supported
Windows (WSL2)Should work
Windows (native)Not tested