API-Docker
view release on metacpan or search on metacpan
lib/API/Docker/Image.pm view on Meta::CPAN
package API::Docker::Image;
# ABSTRACT: Docker image entity
our $VERSION = '0.002';
use Moo;
use namespace::clean;
has client => (
is => 'ro',
weak_ref => 1,
);
has Id => (is => 'ro');
has ParentId => (is => 'ro');
has RepoTags => (is => 'ro');
has RepoDigests => (is => 'ro');
has Created => (is => 'ro');
has Size => (is => 'ro');
has SharedSize => (is => 'ro');
has VirtualSize => (is => 'ro');
has Labels => (is => 'ro');
has Containers => (is => 'ro');
has Architecture => (is => 'ro');
has Os => (is => 'ro');
has Config => (is => 'ro');
has RootFS => (is => 'ro');
has Metadata => (is => 'ro');
sub inspect {
my ($self) = @_;
return $self->client->images->inspect($self->Id);
}
sub history {
my ($self) = @_;
return $self->client->images->history($self->Id);
}
sub tag {
my ($self, %opts) = @_;
return $self->client->images->tag($self->Id, %opts);
}
sub remove {
my ($self, %opts) = @_;
return $self->client->images->remove($self->Id, %opts);
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Image - Docker image entity
=head1 VERSION
version 0.002
=head1 SYNOPSIS
my $docker = API::Docker->new;
my $images = $docker->images->list;
my $image = $images->[0];
say $image->Id;
say join ', ', @{$image->RepoTags};
say $image->Size;
$image->tag(repo => 'myrepo/app', tag => 'v1');
$image->remove;
=head1 DESCRIPTION
This class represents a Docker image. Instances are returned by
L<API::Docker::API::Images> methods.
( run in 0.643 second using v1.01-cache-2.11-cpan-c966e8aa7e8 )