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