API-Docker
view release on metacpan or search on metacpan
lib/API/Docker/Container.pm view on Meta::CPAN
=head2 State
Container state. From C<list>: string like C<running>, C<exited>. From
C<inspect>: hashref with C<Running>, C<Paused>, C<ExitCode>, etc.
=head2 Status
Human-readable status string (e.g., "Up 2 hours").
=head2 Name
Container name (from C<inspect>, includes leading C</>).
=head2 start
$container->start;
Start the container. Delegates to L<API::Docker::API::Containers/start>.
=head2 stop
$container->stop(timeout => 10);
Stop the container. Delegates to L<API::Docker::API::Containers/stop>.
=head2 restart
$container->restart;
Restart the container.
=head2 kill
$container->kill(signal => 'SIGTERM');
Send a signal to the container.
=head2 remove
$container->remove(force => 1);
Remove the container.
=head2 logs
my $logs = $container->logs(tail => 100);
Get container logs.
=head2 inspect
my $updated = $container->inspect;
Get fresh container information.
=head2 pause
$container->pause;
Pause all processes in the container.
=head2 unpause
$container->unpause;
Unpause the container.
=head2 top
my $processes = $container->top;
List running processes in the container.
=head2 stats
my $stats = $container->stats;
Get resource usage statistics.
=head2 is_running
if ($container->is_running) { ... }
Returns true if container is running, false otherwise. Works with both C<list>
and C<inspect> response formats.
=head1 SEE ALSO
=over
=item * L<API::Docker::API::Containers> - Container API operations
=item * L<API::Docker> - Main Docker client
=back
=head1 SUPPORT
=head2 Issues
Please report bugs and feature requests on GitHub at
L<https://github.com/Getty/p5-api-docker/issues>.
=head1 CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
=head1 AUTHOR
Torsten Raudssus <getty@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> L<https://raudssus.de/>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 0.473 second using v1.01-cache-2.11-cpan-995e09ba956 )