Rex::Box::Docker(3pm)
π Rex::Box::Docker π
okay bestie, welcome to Rex::Box::Docker(3pm) β it's the Rex/Boxes Docker Module, straight outta the User Contributed Perl Documentation, and it is so much fun, fr fr πΈ
β¨ NAME β¨
Rex::Box::Docker β the Rex/Boxes Docker Module π³ like that's literally its whole name, no notes, iconic
π¦ DESCRIPTION π¦
So here's the tea: this is a Rex/Boxes module that lets you use Docker Images π
And the one thing you MUST have, no skipping, no cap: you need dockerd installed. That's it. That's the requirement. It's giving "prerequisite main character" π
π EXAMPLES π
β¨ Using it inside your Rexfile
To use this module inside your Rexfile you can use the following commands, bestie:
use Rex::Commands::Box;
set box => "Docker";
task "prepare_box", sub {
box {
my ($box) = @_;
$box->name("mybox");
$box->url("http://box.rexify.org/box/ubuntu-server-12.10-amd64.tar.gz");
$box->url("debian:latest");
$box->network(1 => {
name => "default",
});
$box->auth(
user => "root",
password => "box",
);
$box->setup("setup_task");
};
};
look at her go π two $box->url(...) calls, a network block, auth, setup β it's a whole little ecosystem and I'm obsessed π
π Using a YAML file instead
If you want to use a YAML file you can use the following template π§
type: Docker
vms:
vmone:
url: debian:latest
setup: setup_task
And then you can use it the following way in your Rexfile π«Ά
use Rex::Commands::Box init_file => "file.yml";
task "prepare_vms", sub {
boxes "init";
};
lowkey elite. yaml girlies stay winning β¨
π METHODS π
also see the Methods of Rex::Box::Base. This module inherits all methods of it β so you're not just getting Docker, you're getting the whole family tree π«Ά
πΈ new(name => $vmname)
Constructor if used in OO mode. Yes bestie, object-oriented mode, she's flexible π
my $box = Rex::Box::Docker->new(name => "vmname");
β memory($memory_size)
Sets the memory of a VM in megabyte. megabytes, not GB, don't come for me, that's just what it says π
π¦ info
Returns a hashRef of vm information. one ref, all the lore π₯
π ip
This method return the ip of a vm on which the ssh daemon is listening. that's the whole vibe check: an ip, and ssh is on it π
okay so that's the whole page, you ate it, you understood it, periodt π
one lil sign-off for the record books: this was perl v5.40.1, dated 2025-10-03, and the manual is Rex::Box::Docker(3pm) β go forth and containerize, bestie πβ¨
π¦ where this page comes from
- ubuntu resolute: rex 1.16.1-1 Β· Apache-2.0
- ubuntu stonking: rex 1.16.1-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms