SYNOPSIS
my $docker = WWW::Docker->new;
# Create an exec instance
my $exec = $docker->exec->create($container_id,
Cmd => ['/bin/sh', '-c', 'echo hello'],
AttachStdout => 1,
AttachStderr => 1,
);
# Start the exec
$docker->exec->start($exec->{Id});
# Inspect exec instance
my $info = $docker->exec->inspect($exec->{Id});
DESCRIPTION
This module provides methods for executing commands inside running containers using the Docker Exec API.
Accessed via $docker->exec.
Reference to WWW::Docker client. Weak reference to avoid circular dependencies.
my $exec = $docker->exec->create($container_id,
Cmd => ['/bin/sh', '-c', 'echo hello'],
AttachStdout => 1,
AttachStderr => 1,
Tty => 0,
);
Create an exec instance. Returns hashref with Id.
Required config: Cmd (ArrayRef of command and arguments).
Common config keys: AttachStdin, AttachStdout, AttachStderr, Tty, Env, User, WorkingDir.
$exec->start($exec_id, Detach => 0);
Start an exec instance. Options: Detach, Tty.
$exec->resize($exec_id, h => 40, w => 120);
Resize the TTY for an exec instance. Options: h (height), w (width).
my $info = $exec->inspect($exec_id);
Get information about an exec instance.
WWW::Docker - Main Docker client
WWW::Docker::API::Containers - Container management
6 POD Errors
The following errors were encountered while parsing the POD:
- Around line 42:
Unknown directive: =attr
- Around line 55:
Unknown directive: =method
- Around line 83:
Unknown directive: =method
- Around line 100:
Unknown directive: =method
- Around line 114:
Unknown directive: =method
- Around line 122:
Unknown directive: =seealso