Eixo-Docker
view release on metacpan or search on metacpan
lib/Eixo/Docker.pod view on Meta::CPAN
Name => $name,
HostConfig => {
Binds => {
'/mnt:/tmp',
'/usr:/usr:ro'
},
}
);
I<When starting the container the volumes will be seen as 'Mounts' (since docker api v1.20)>
"Mounts": [
{
"Source": "/mnt",
"Destination": "/tmp",
"Mode": "",
"RW": true
},
{
"Source": "/usr",
"Destination": "/usr",
"Mode": "",
"RW": false
}
],
=head3 Deleting a container
## delete
$container->delete();
=head3 Deleting a container (asynchronous version)
my $job_id = $container->deleteAsync(
onSuccess=>sub {
#
# Container has been deleted
#
}
);
# Others things to do...
#
#
# 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";
}
);
=head3 Building images (from a Dockerfile)
## build
my $image = $a->images->build(
t => "my_image",
Dockerfile => join("\n", <DATA>),
);
## build_from_dir
my $image = $a->images->build_from_dir(
t => "my_image",
DIR => "/tmp/directory_with_a_Dockerfile"
);
=head3 Deleting an image
## delete
$image->delete();
=head1 DESCRIPTION
The purpose of this library is to provide a set of modules to interact in a
simple, but powerful way, with the L<Docker remote api |http://docs.docker.io/en/latest/reference/api/docker_remote_api/>
B<Containers> supported methods:
=over
=item *
get
=item *
getByName
=item *
getAll
=item *
( run in 1.022 second using v1.01-cache-2.11-cpan-0d23b851a93 )