NAME
Podman::Container - Create and control container.
SYNOPSIS
# Create container
my $container = Podman::Container::create('nginx', 'docker.io/library/nginx');
# Start container
$container->start();
# Stop container
$container->stop();
# Kill container
$container->kill();
DESCRIPTION
Inheritance
Podman::Containers
isa Podman::Client
Podman::Container provides functionallity to control a container.
ATTRIBUTES
Podman::Container implements following attributes.
name
my $container = Podman::Container->new();
$container->name('docker.io/library/hello-world');
Unique image name or other identifier.
FUNCTIONS
Podman::Image implements the following functions, which can be imported individually.
create
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.
METHODS
Podman::Container implements following methods.
inspect
my $Info = $container->inspect;
Return advanced container information.
kill
$container->kill('SIGKILL');
Send signal to container, defaults to 'SIGTERM'.
pause
$container->pause;
Pause running container.
remove
$container->Delete(1);
Remove stopped container. Takes additional argument force to remove even running container.
start
$container->start;
Start stopped container.
stats
my $stats = $container->stats;
for my $property (keys %{$stats}) {
printf "%s: %s\n", $property, $stats->{$property};
}
Return current usage statistics of running container.
stop
$container->stop;
Stop running container.
systemd
my $unit = $container->systemd;
Generate unit file to supervise container by systemd.
unpause
$container->unpause;
Resume paused container.
AUTHORS
Tobias Schäfer, <tschaefer@blackox.org>
COPYRIGHT AND LICENSE
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.