testcontainers_core 1.0.14 copy "testcontainers_core: ^1.0.14" to clipboard
testcontainers_core: ^1.0.14 copied to clipboard

Dart library for throwaway instances of anything that can run in a Docker container

example/example.dart

import 'package:testcontainers_core/testcontainers_core.dart';

void main() async {
  await DockerContainer.use(
    DockerContainer('redis:7-alpine').withExposedPorts([6379]).waitingFor(
      LogMessageWaitStrategy(r'Ready to accept connections'),
    ),
    (container) async {
      final host = await container.containerHostIp();
      final port = await container.exposedPort(6379);
      // connect to redis on host:port
      assert(host.isNotEmpty);
      assert(port > 0);
    },
  );
}
0
likes
155
points
67
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Dart library for throwaway instances of anything that can run in a Docker container

Repository (GitHub)
View/report issues

Topics

#testing #docker #containers #test-automation

Funding

Consider supporting this project:

github.com

License

Apache-2.0 (license)

Dependencies

archive, http, meta, path, uuid

More

Packages that depend on testcontainers_core