NAME

WWW::Docker::API::Exec - Docker Engine Exec API

VERSION

version 0.100

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.

client

Reference to WWW::Docker client. Weak reference to avoid circular dependencies.

create

my $exec = $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.

start

$exec->start($exec_id, Detach => 0);

Start an exec instance. Options: Detach, Tty.

resize

$exec->resize($exec_id, h => 40, w => 120);

Resize the TTY for an exec instance. Options: h (height), w (width).

inspect

my $info = $exec->inspect($exec_id);

Get information about an exec instance.

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-www-docker/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2025 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.