Build Status Coverage Status

NAME

Test::Docker::Image - It's new $module, this can handle a Docker image for tests.

SYNOPSIS

use Test::Docker::Image;

my $mysql_image_guard = Test::Docker::Image->new(
    container_ports => [3306],
    tag             => 'iwata/centos6-mysql51-q4m-hs',
);

my $port = $mysql_image_guard->port(3306);
my $host = $mysql_image_guard->host;

`mysql -uroot -h$host -P$port -e 'show plugins'`;
undef $mysql_image_guard; # destroy a guard object and execute docker kill and rm the container.

DESCRIPTION

Test::Docker::Image is a module to handle a Docker image.

METHODS

new

return an instance of Test::Docker::Image, this instance is used as a guard object.

port

Return a port number, this Docker image use number for port forwarding.

host

Return an IP address of Docker host.

LICENSE

Copyright (C) iwata-motonori.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Motonori Iwata gootonroi+github@gmail.com