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.terminateContainer.with_containerfor 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 portfor_log- Wait for log messagefor_log_regex- Wait for log patternfor_http- Wait for HTTP endpointfor_exec- Wait for command successfor_health_check- Wait for Docker health checkallandanycombinators- Configurable timeouts and poll intervals
- Docker network support
Network.createandNetwork.removeNetwork.with_networkfor automatic cleanup
- File operations
Container.copy_file_to- Copy file to containerContainer.copy_file_from- Copy file from containerContainer.copy_content_to- Copy string content to container
- Pre-built modules
testcontainers-postgres- PostgreSQLtestcontainers-mysql- MySQLtestcontainers-mongo- MongoDBtestcontainers-redis- Redistestcontainers-rabbitmq- RabbitMQtestcontainers-kafka- Apache Kafka (KRaft mode)testcontainers-elasticsearch- Elasticsearchtestcontainers-localstack- LocalStack (AWS emulation)testcontainers-memcached- Memcachedtestcontainers-mockserver- MockServer (HTTP mocking)
- Container inspection features
Container.container_ip- Get container IP addressContainer.container_ips- Get all container IPs (multi-network)Container.network_aliases- Get network aliasesContainer.gateway- Get gateway addressContainer.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 Version | Status |
|---|---|
| 5.2.x | Supported |
| 5.1.x | Supported |
| 5.0.x | Supported |
| < 5.0 | Not supported |
| Docker Version | Status |
|---|---|
| 24.x | Tested |
| 23.x | Should work |
| 20.x+ | Should work |
| Platform | Status |
|---|---|
| Linux | Fully supported |
| macOS (Docker Desktop) | Fully supported |
| Windows (WSL2) | Should work |
| Windows (native) | Not tested |