DockerTemplateSchema

From Unraid | Docs
Jump to: navigation, search

Docker Template Schema

As many of you know, templates are the preferred way to distribute and deploy Docker containers in unRAID. The language used to write templates for unRAID is XML, a well proven and established markup language that is both extensible and human readable, making it perfect for the task.

Below are the supported elements:

Name

This is the default container's name, and work as a suggestion for the user.

Attributes:

  • Default: this is the default value for this element.
 <?xml version="1.0" encoding="utf-8"?>
 <Container version="2">
   <Name Default="Sync">Sync</Name>
 </Container>

 

Overview

In this element, you can add a small description of the application, like it's features.

 <?xml version="1.0" encoding="utf-8"?>
 <Container version="2">
   <Overview>
    BitTorrent Sync, or simply - Sync - is an application for data synchronization. Its primary goal is to keep designated folder content same on 2 or more devices 
    / computers.As soon as something changes on one computer, change (would it be changed content of a file, file renaming or deletion, etc.) should be 
    propagated to all other computer(s) that want to keep the folder synchronized. Sync is available for a bunch of platforms, both desktop and mobile, which gives 
    a good usage flexibility.
   </Overview>
 </Container>

 

Registry

This element stores the container's respective Docker Registry URL. This is used to retrieve update information.

 <?xml version="1.0" encoding="utf-8"?>
 <Container version="2">
   <Registry>https://registry.hub.docker.com/u/limetech/sync/</Registry>
 </Container>

 

Repository

This element stores the container's repository, and is normally composed by the Docker Registry username and the container's name (user/container), or username, container's name and label (user/container:label).

 <?xml version="1.0" encoding="utf-8"?>
 <Container version="2">
   <Repository>limetech/sync</Repository>
 </Container>

 

Support

This element holds an URL for a forum's support thread.

 <?xml version="1.0" encoding="utf-8"?>
 <Container version="2">
   <Support>http://lime-technology.com/forum/index.php?topic=40654.0</Support>
 </Container>

 

Network

This element holds all the info about container's network.

Values

  • Bridge: this is Docker's default option, where all the network interactions happen behind a NAT layer, which has a performance cost. In bridge mode, only mapped ports will be exposed on unRAID's network address.
  • Host: Explaining text
  • None: Explaining text

Attributes:

  • Default: this is the default value for this element.
 <?xml version="1.0" encoding="utf-8"?>
 <Container version="2">
   <Network Default="host">bridge</Network>
 </Container>

Config

The Config elements holds all configuration needed to make the inside app work.

Config Types:

There are many config types available to template authors:

 

1) Path

A Path Config element holds information about a Docker volume mapping.

Value:

The value of this element is the path chosen by the user.

Attributes:

  • Name: This is the directory path at container's side, e.g., /config, /tvshows, /music, /movies etc...
  • Title: This attribute hold the path title. e.g, Config Directory, TV Shows, Movies etc...
  • Default: This is the default path for this element.
  • Mode: This attribute value can be rw for read/write permissions, or ro for read-only permissions.
  • Description: This is a small description of this path settings and usage.
  • Display: This attribute will be visible to the user always, advanced view, or if it will be hidden from the user regardless of basic/advanced view mode. Default: always.
  • Required: If this attribute is required, this must be set to true; otherwise, set it to false (default).
 <?xml version="1.0" encoding="utf-8"?>
 <Container version="2">
   <Config Type="Path" Name="/config" Title="Config directory" Default="/mnt/user/appdata/PMS" Mode="rw" Description="This is where PMS will store it's databases 
    and configuration.">/mnt/user/appdata/PMS</Config>
 </Container>
 

2) Variable

A Variable Config element holds information about a Docker environment variable.

Value:

The value of this variable according to user's input.

Attributes:

  • Name: This is the variable name that will be available inside the container, like WEB_PORT, USERNAME, PASSWORD etc...
  • Title: This is the variable title at the WebUI, like Web Interface Port, Login Name, Login password etc...
  • Default: This is the default value for this element.
  • Description: This is a small description of this path settings and usage. Default: nothing.
  • Display: This attribute will be visible to the user always, advanced view, or if it will be hidden from the user regardless of basic/advanced view mode. Default: always.
  • Required: If this attribute is required, this must be set to true. Default: false.
  • Mask: If set to true, it will mask the user's input. Useful for password input, Default: false.
 <?xml version="1.0" encoding="utf-8"?>
 <Container version="2">
   <Config 
       Type="Variable" 
       Name="PLEXPASS_USERNAME" 
       Title="Plex Pass Username" 
       Default="" 
       Description="Plex Pass Username" 
       Mask="false" 
       Display="advanced" 
       Required="false">Username</Config>
 </Container>

 

3) Port

A Port Config element holds information about a Docker exposed port, and is only relevant when used in conjunction with bridge network mode.

Value:

The host correspondent of this port, according to user's input.

Attributes:

  • Name: This is the port number that will be exposed from the, container, like 80, 443, 8080 etc...
  • Title: This is the port title shown at the WebUI, like Web Interface Port, Service Port, HTTPS Port etc...
  • Default: This is the default value for this element.
  • Mode: This attribute value can be tcp for TCP protocol, or udp for UDP protocol.
  • Description: This is a small description of this port settings and usage. Default: nothing.
  • Display: This attribute will be visible to the user always, advanced view, or if it will be hidden from the user regardless of basic/advanced view mode. Default: always.
  • Required: If this attribute is required, this must be set to true. Default: false.
 <?xml version="1.0" encoding="utf-8"?>
 <Container version="2">
   <Config 
       Type="Port" 
       Name="32400" 
       Title="Plex Web UI" 
       Default="32400" 
       Mode="tcp" 
       Description="This is PMS Web UI Port, and is used to access and configure your media library." 
       Display="always" 
       Required="true">32400</Config>
 </Container>

 

WebUI

The WebUI element holds a mask for the
 <WebUI>http://[IP]:[PORT:32400]/web/index.html</WebUI>
 <Icon>http://d2631fvi2jdnb6.cloudfront.net/docker/limetech/plex.png</Icon>