Podman::Container - Create and control container.
# Create container use Podman::Container qw(create); my $container = create('nginx', 'docker.io/library/nginx'); # Start container $container->start; # Stop container $container->stop; # Kill container $container->kill;
Podman::Container isa Podman::Client
Podman::Container provides functionallity to create and control a container.
Podman::Container implements following attributes.
my $container = Podman::Container->new; $container->name('docker.io/library/hello-world');
Unique image name or (short) identifier.
Podman::Container implements the following functions, which can be imported individually.
use Podman::Container qw(create); my $container = create( 'nginx', 'docker.io/library/nginx', tty => 1, interactive => 1, );
Create named container by given image <Podman::Image> object or name and additional create options.
Podman::Container implements following methods.
my $info = $container->inspect;
Return advanced container information.
$container->kill('SIGKILL');
Send signal to container, defaults to 'SIGTERM'.
$container->pause;
Pause running container.
my $force = 1; $container->remove($force);
Remove stopped container. Takes additional argument force to remove even running container.
$container->start;
Start stopped container.
my $stats = $container->stats; for my $property (keys %{$stats}) { say $property . ': ' . $stats->{$property}; }
Return current usage statistics of running container.
$container->stop;
Stop running container.
my $unit = $container->systemd;
Generate unit file to supervise container by systemd.
$container->unpause;
Resume paused container.
Tobias Schäfer, <tschaefer@blackox.org>
Copyright (C) 2022-2022, Tobias Schäfer.
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
To install Podman, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Podman
CPAN shell
perl -MCPAN -e shell install Podman
For more information on module installation, please visit the detailed CPAN module installation guide.