Eixo-Docker
view release on metacpan or search on metacpan
#
# We wait for the specific job to finish
#
$api->waitForJob($job_id);
=head2 Interacting with images
=head3 Getting an image
## get
my $image = $a->images->get(id => "busybox");
=head3 Getting an image history
## history
print Dumper($image->history);
=head3 Create an image pulling it from registry
## create
my $image = $a->images->create(
fromImage=>'busybox',
onSuccess=>sub {
print "FINISHED\n";
},
onProgress=>sub{
print $_[0] . "\n";
lib/Eixo/Docker.pod view on Meta::CPAN
#
# We wait for the specific job to finish
#
$api->waitForJob($job_id);
=head2 Interacting with images
=head3 Getting an image
## get
my $image = $a->images->get(id => "busybox");
=head3 Getting an image history
## history
print Dumper($image->history);
=head3 Create an image pulling it from registry
## create
my $image = $a->images->create(
fromImage=>'busybox',
onSuccess=>sub {
print "FINISHED\n";
},
onProgress=>sub{
print $_[0] . "\n";
t/040_images_integration.t view on Meta::CPAN
push @calls, $data->[1];
});
my @res;
eval{
$a->images->create(
fromImage=>'busybox',
tag => 'latest',
onSuccess=>sub {
print "FINISHED\n";
},
onProgress=>sub{
print $_[0] . "\n";
}
);
my $image = $a->images->get(id => "busybox");
ok(
ref($image) eq "Eixo::Docker::Image",
"Images::get returns the busybox docker image if exists"
);
$a->images->getAsync(
id => 'busybox',
onSuccess=>sub {
# print Dumper($_[0]);
print "Encontrada imagen 426...\n";
#print Dumper(@_);
push @res, $_[0];
},
onError => sub {
print "No se encontrou tal imaxen\n";
t/040_images_integration.t view on Meta::CPAN
onSuccess=> sub {
$res = $_[0];
}
);
$a->waitForJobs;
ok(ref $res eq "ARRAY", "List images returns an array");
ok(
scalar(
grep {$_ =~ /^busybox/} map {@{$_->RepoTags}} @$res
),
"Find busybox image in image list"
);
};
if($@){
print Dumper($@);
}
}
done_testing();
( run in 0.273 second using v1.01-cache-2.11-cpan-87723dcf8b7 )