1Rex::Box::Docker(3)   User Contributed Perl Documentation  Rex::Box::Docker(3)
2
3
4

NAME

6       Rex::Box::Docker - Rex/Boxes Docker Module
7

DESCRIPTION

9       This is a Rex/Boxes module to use Docker Images. You need to have
10       dockerd installed.
11

EXAMPLES

13       To use this module inside your Rexfile you can use the following
14       commands.
15
16        use Rex::Commands::Box;
17        set box => "Docker";
18
19        task "prepare_box", sub {
20           box {
21              my ($box) = @_;
22
23              $box->name("mybox");
24              $box->url("http://box.rexify.org/box/ubuntu-server-12.10-amd64.tar.gz");
25              $box->url("debian:latest");
26
27              $box->network(1 => {
28                 name => "default",
29              });
30
31              $box->auth(
32                 user => "root",
33                 password => "box",
34              );
35
36              $box->setup("setup_task");
37           };
38        };
39
40       If you want to use a YAML file you can use the following template.
41
42        type: Docker
43        vms:
44           vmone:
45              url: debian:latest
46              setup: setup_task
47
48       And then you can use it the following way in your Rexfile.
49
50        use Rex::Commands::Box init_file => "file.yml";
51
52        task "prepare_vms", sub {
53           boxes "init";
54        };
55

METHODS

57       See also the Methods of Rex::Box::Base. This module inherits all
58       methods of it.
59
60   new(name => $vmname)
61       Constructor if used in OO mode.
62
63        my $box = Rex::Box::Docker->new(name => "vmname");
64
65   memory($memory_size)
66       Sets the memory of a VM in megabyte.
67
68   info
69       Returns a hashRef of vm information.
70
71   ip
72       This method return the ip of a vm on which the ssh daemon is listening.
73
74
75
76perl v5.32.1                      2021-03-06               Rex::Box::Docker(3)
Impressum