Skip to content

A simple docker client for spinning up docker containers

License

Notifications You must be signed in to change notification settings

paradoxical-io/docker-client

Repository files navigation

docker-client

Build status

A simplified docker client that wraps the spotify client with simpler options that always generates random transientPorts for host proxying. Great for testing!

To install

<dependency>
    <groupId>io.paradoxical</groupId>
    <artifactId>docker-client</artifactId>
    <version>1.0</version>
</dependency>

Usage

final DockerClientConfig config =
        DockerClientConfig.builder()
                          .imageName("rabbitmq:management")
                          .port(5672)
                          .waitForLogLine("Server startup complete")
                          .build();

try (final Container client = DockerCreator.build(config)) {
    ConnectionFactory factory = new ConnectionFactory();
    factory.setHost(client.getDockerHost());
    factory.setPort(client.getTargetPortToHostPortLookup().get(5672));
    factory.newConnection();
}

About

A simple docker client for spinning up docker containers

Resources

License

Stars

Watchers

Forks

Packages

No packages published