github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/docs/drivers/external/pot.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Drivers: pot'
     4  sidebar_title: Pot
     5  description: >-
     6    The Pot task driver is used to run pot (https://github.com/pizzamig/pot)
     7    containers using FreeBSD jails.
     8  ---
     9  
    10  # Pot Task Driver
    11  
    12  Name: `pot`
    13  
    14  The Pot task driver provides an interface for using [pot][pot-github-repo] for dynamically running applications inside a FreeBSD Jail.
    15  You can download the external nomad-pot-driver [here][nomad-pot-driver].
    16  
    17  ## Task Configuration
    18  
    19  ```hcl
    20  task "nginx-pot" {
    21      driver = "pot"
    22  
    23      config {
    24        image = "https://pot-registry.zapto.org/registry/"
    25        pot = "FBSD120-nginx"
    26        tag = "1.0"
    27        command = "nginx"
    28        args = [
    29          "-g 'daemon off;'"
    30        ]
    31        network_mode = "public-bridge"
    32        port_map = {
    33          http = "80"
    34        }
    35        copy = [
    36          "/root/index.html:/usr/local/www/nginx-dist/index.html",
    37          "/root/nginx.conf:/usr/local/etc/nginx/nginx.conf"
    38        ]
    39        mount = [
    40          "/tmp/test:/root/test",
    41        ]
    42        mount_read_only = [
    43          "/tmp/test2:/root/test2"
    44        ]
    45        extra_hosts = [
    46          "artifactory.yourdomain.com:192.168.0.1",
    47          "mail.yourdomain.com:192.168.0.2"
    48        ]
    49     }
    50  }
    51  ```
    52  
    53  The pot task driver supports the following parameters:
    54  
    55  - `image` - The url for the http registry from where to get the image.
    56  
    57  - `pot` - Name of the image in the registry.
    58  
    59  - `tag` - Version of the image.
    60  
    61  - `command` - Command that is going to be executed once the jail is started.
    62  
    63  - `args` - (Optional) List of options for the command executed on the command argument.
    64  
    65  - `network_mode` - (Optional) Defines the network mode of the pot. Default: **"public-bridge"**
    66  
    67    Possible values are:
    68  
    69    **"public-bridge"** pot creates an internal virtual network with a NAT table where all traffic is going to be sent.
    70  
    71    **"host"** pot bounds the jail directly to a host port.
    72  
    73  - `port_map` - (Optional) Sets the port on which the application is listening inside of the jail. If not set, the application will inherit the port configuration from the image.
    74  
    75  - `copy` - (Optional) Copies a file from the host machine to the pot jail in the given directory.
    76  
    77  - `mount` - (Optional) Mounts a read/write folder from the host machine to the pot jail.
    78  
    79  - `mount_read_only` - (Optional) Mounts a read only directory inside the pot jail.
    80  
    81  - `extra_hosts` - (Optional) A list of hosts, given as host:IP, to be added to /etc/hosts
    82  
    83  ## Client Requirements
    84  
    85  `pot Task Driver` requires the following:
    86  
    87  - 64-bit FreeBSD 12.0-RELEASE host .
    88  - The FreeBSD's Nomad binary (available as a package).
    89  - The pot-task-driver binary placed in the [plugin_dir][plugin_dir] directory.
    90  - Installing [pot][pot-github-repo] and following the install [guide][pot-install-guide].
    91  - Webserver from where to serve the images. (simple file server)
    92  - Following lines need to be included in your rc.conf
    93  
    94  ```
    95  nomad_user="root"
    96  nomad_env="PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/sbin:/bin"
    97  ```
    98  
    99  [nomad-pot-driver]: https://github.com/trivago/nomad-pot-driver
   100  [plugin_dir]: /docs/configuration#plugin_dir
   101  [pot-github-repo]: https://github.com/pizzamig/pot
   102  [pot-install-guide]: https://github.com/pizzamig/pot/blob/master/share/doc/pot/Installation.md