Site updated at 2017-09-26 07:14:23 UTC
This commit is contained in:
parent
80847eb95a
commit
b723b0750d
415 changed files with 2329 additions and 1581 deletions
|
@ -86,21 +86,22 @@
|
|||
<p>When developing your script:</p>
|
||||
<ul>
|
||||
<li><code class="highlighter-rouge">/data</code> is a volume for persistent storage.</li>
|
||||
<li><code class="highlighter-rouge">/data/options.json</code> contains the user configuration. You can use <code class="highlighter-rouge">jq</code> inside your shell script to parse this data. However you might have to install <code class="highlighter-rouge">jq</code> as a separate package in your container (see <code class="highlighter-rouge">Dockerfile</code> below).</li>
|
||||
<li><code class="highlighter-rouge">/data/options.json</code> contains the user configuration. You can use <code class="highlighter-rouge">jq</code> inside your shell script to parse this data. However, you might have to install <code class="highlighter-rouge">jq</code> as a separate package in your container (see <code class="highlighter-rouge">Dockerfile</code> below).</li>
|
||||
</ul>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="nv">CONFIG_PATH</span><span class="o">=</span>/data/options.json
|
||||
|
||||
<span class="nv">TARGET</span><span class="o">=</span><span class="k">$(</span>jq --raw-output <span class="s2">".target"</span> <span class="nv">$CONFIG_PATH</span><span class="k">)</span>
|
||||
<span class="nv">TARGET</span><span class="o">=</span><span class="s2">"</span><span class="k">$(</span>jq --raw-output <span class="s1">'.target'</span> <span class="nv">$CONFIG_PATH</span><span class="k">)</span><span class="s2">"</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>So if your <code class="highlighter-rouge">options</code>contain</p>
|
||||
<p>So if your <code class="highlighter-rouge">options</code> contain</p>
|
||||
<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w"> </span><span class="nt">"target"</span><span class="p">:</span><span class="w"> </span><span class="s2">"beer"</span><span class="w"> </span><span class="p">}</span><span class="w">
|
||||
</span></code></pre>
|
||||
</div>
|
||||
<p>then there will be a variable <code class="highlighter-rouge">TARGET</code>containing <code class="highlighter-rouge">beer</code> in the environment of your bash file afterwards.</p>
|
||||
<p>then there will be a variable <code class="highlighter-rouge">TARGET</code> containing <code class="highlighter-rouge">beer</code> in the environment of your bash file afterwards.</p>
|
||||
<h2><a class="title-link" name="add-on-docker-file" href="#add-on-docker-file"></a> Add-on Docker file</h2>
|
||||
<p>All add-ons are based on Alpine Linux 3.6. Hass.io will automatically substitute the right base image based on the machine architecture. Add <code class="highlighter-rouge">tzdata</code> if you need run in correct timezone, but that is already add in our base images.</p>
|
||||
<div class="highlighter-rouge"><pre class="highlight"><code>FROM %%BASE_IMAGE%%
|
||||
<p>All add-ons are based on Alpine Linux 3.6. Hass.io will automatically substitute the right base image based on the machine architecture. Add <code class="highlighter-rouge">tzdata</code> if you need run in a different timezone. <code class="highlighter-rouge">tzdata</code> Is is already added to our base images.</p>
|
||||
<div class="highlighter-rouge"><pre class="highlight"><code>ARG BUILD_FROM
|
||||
FROM $BUILD_FROM
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
|
@ -118,14 +119,31 @@ CMD [ "/run.sh" ]
|
|||
<div class="highlighter-rouge"><pre class="highlight"><code>LABEL io.hass.version="VERSION" io.hass.type="addon" io.hass.arch="armhf|aarch64|i386|amd64"
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>It is possible to use own base image with follow schema:</p>
|
||||
<div class="highlighter-rouge"><pre class="highlight"><code>#amd64:FROM...
|
||||
#i386:FROM...
|
||||
#armhf:FROM...
|
||||
#aarch64:FROM...
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Or if you not want to do a multi arch build/support you can also use a simle docker <code class="highlighter-rouge">FROM</code>.</p>
|
||||
<p>It is possible to use own base image with <code class="highlighter-rouge">build.json</code> or if you do not need support for automatic multi-arch building you can also use a simple docker <code class="highlighter-rouge">FROM</code>.</p>
|
||||
<h3><a class="title-link" name="build-args" href="#build-args"></a> Build Args</h3>
|
||||
<p>We support the following build arguments by default:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ARG</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>BUILD_FROM</td>
|
||||
<td>Hold image for dynamic builds or buildings over our systems.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BUILD_VERSION</td>
|
||||
<td>Add-on version (read from <code class="highlighter-rouge">config.json</code>).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BUILD_ARCH</td>
|
||||
<td>Hold current build arch inside.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2><a class="title-link" name="add-on-config" href="#add-on-config"></a> Add-on config</h2>
|
||||
<p>The config for an add-on is stored in <code class="highlighter-rouge">config.json</code>.</p>
|
||||
<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
|
||||
|
@ -189,12 +207,12 @@ CMD [ "/run.sh" ]
|
|||
<tr>
|
||||
<td>startup</td>
|
||||
<td>yes</td>
|
||||
<td><code class="highlighter-rouge">initialize</code> will start addon on setup of hassio. <code class="highlighter-rouge">system</code> is for things like database and base not on other things. <code class="highlighter-rouge">services</code> will start before homeassistant. <code class="highlighter-rouge">application</code> is after homeassistant will start or <code class="highlighter-rouge">once</code> for application they don’t run as deamon.</td>
|
||||
<td><code class="highlighter-rouge">initialize</code> will start addon on setup of Hass.io. <code class="highlighter-rouge">system</code> is for things like databases and not dependent on other things. <code class="highlighter-rouge">services</code> will start before Home Assistant, while <code class="highlighter-rouge">application</code> is started afterwards. Finally <code class="highlighter-rouge">once</code> is for applications that don’t run as a daemon.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>webui</td>
|
||||
<td>no</td>
|
||||
<td>A URL for webinterface of this add-on. Like <code class="highlighter-rouge">http://[HOST]:[PORT:2839]/dashboard</code>, the port need the internal port, we replace it later with the effective port.</td>
|
||||
<td>A URL for web interface of this add-on. Like <code class="highlighter-rouge">http://[HOST]:[PORT:2839]/dashboard</code>, the port needs the internal port, which will be replaced with the effective port.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>boot</td>
|
||||
|
@ -214,12 +232,12 @@ CMD [ "/run.sh" ]
|
|||
<tr>
|
||||
<td>devices</td>
|
||||
<td>no</td>
|
||||
<td>Device list to map into add-on. Format is: <code class="highlighter-rouge"><path_on_host>:<path_in_container>:<cgroup_permissions></code>. i.e. <code class="highlighter-rouge">/dev/ttyAMA0:/dev/ttyAMA0:rwm</code></td>
|
||||
<td>Device list to map into the add-on. Format is: <code class="highlighter-rouge"><path_on_host>:<path_in_container>:<cgroup_permissions></code>. i.e. <code class="highlighter-rouge">/dev/ttyAMA0:/dev/ttyAMA0:rwm</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>hassio_api</td>
|
||||
<td>no</td>
|
||||
<td>This add-on can access to hass.io REST API. It set the host alias <code class="highlighter-rouge">hassio</code>.</td>
|
||||
<td>This add-on can access to Hass.io REST API. It set the host alias <code class="highlighter-rouge">hassio</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>privileged</td>
|
||||
|
@ -229,7 +247,7 @@ CMD [ "/run.sh" ]
|
|||
<tr>
|
||||
<td>map</td>
|
||||
<td>no</td>
|
||||
<td>List of maps for additional hass.io folders. Possible values: <code class="highlighter-rouge">config</code>, <code class="highlighter-rouge">ssl</code>, <code class="highlighter-rouge">addons</code>, <code class="highlighter-rouge">backup</code>, <code class="highlighter-rouge">share</code>. Default it map it <code class="highlighter-rouge">ro</code>, you can change that if you add a “:rw” at the end of name.</td>
|
||||
<td>List of maps for additional Hass.io folders. Possible values: <code class="highlighter-rouge">config</code>, <code class="highlighter-rouge">ssl</code>, <code class="highlighter-rouge">addons</code>, <code class="highlighter-rouge">backup</code>, <code class="highlighter-rouge">share</code>. Defaults to <code class="highlighter-rouge">ro</code>, which you can change by adding <code class="highlighter-rouge">:rw</code> to the end of the name.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>environment</td>
|
||||
|
@ -239,7 +257,7 @@ CMD [ "/run.sh" ]
|
|||
<tr>
|
||||
<td>audio</td>
|
||||
<td>no</td>
|
||||
<td>Mark this add-on to use internal audio system. Environment is <code class="highlighter-rouge">ALSA_INPUT</code> and <code class="highlighter-rouge">ALSA_OUTPUT</code> to access the internal information for alsa.</td>
|
||||
<td>Mark this add-on to use internal an audio system. The available environment variables are <code class="highlighter-rouge">ALSA_INPUT</code> and <code class="highlighter-rouge">ALSA_OUTPUT</code> which provide internal information to access alsa.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>options</td>
|
||||
|
@ -254,7 +272,7 @@ CMD [ "/run.sh" ]
|
|||
<tr>
|
||||
<td>image</td>
|
||||
<td>no</td>
|
||||
<td>For use dockerhub.</td>
|
||||
<td>For use with Docker Hub.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>timeout</td>
|
||||
|
@ -269,7 +287,7 @@ CMD [ "/run.sh" ]
|
|||
</tbody>
|
||||
</table>
|
||||
<h3><a class="title-link" name="options--schema" href="#options--schema"></a> Options / Schema</h3>
|
||||
<p>The <code class="highlighter-rouge">options</code> dict contains all available options and their default value. Set the default value to <code class="highlighter-rouge">null</code> if the value is required to be given by the user before the add-on can start. Only non-nested arrays and dictorys are supported.</p>
|
||||
<p>The <code class="highlighter-rouge">options</code> dictionary contains all available options and their default value. Set the default value to <code class="highlighter-rouge">null</code> if the value is required to be given by the user before the add-on can start. Only non-nested arrays and dictionaries are supported.</p>
|
||||
<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"custom things"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"logins"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
|
@ -277,7 +295,9 @@ CMD [ "/run.sh" ]
|
|||
</span><span class="p">{</span><span class="w"> </span><span class="nt">"username"</span><span class="p">:</span><span class="w"> </span><span class="s2">"cheep"</span><span class="p">,</span><span class="w"> </span><span class="nt">"password"</span><span class="p">:</span><span class="w"> </span><span class="s2">"654321"</span><span class="w"> </span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">],</span><span class="w">
|
||||
</span><span class="nt">"random"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"haha"</span><span class="p">,</span><span class="w"> </span><span class="s2">"hihi"</span><span class="p">,</span><span class="w"> </span><span class="s2">"huhu"</span><span class="p">,</span><span class="w"> </span><span class="s2">"hghg"</span><span class="p">],</span><span class="w">
|
||||
</span><span class="nt">"link"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://blebla.com/"</span><span class="w">
|
||||
</span><span class="nt">"link"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://example.com/"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"size"</span><span class="p">:</span><span class="w"> </span><span class="mi">15</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"count"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.2</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre>
|
||||
</div>
|
||||
|
@ -287,8 +307,10 @@ CMD [ "/run.sh" ]
|
|||
</span><span class="nt">"logins"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w"> </span><span class="nt">"username"</span><span class="p">:</span><span class="w"> </span><span class="s2">"str"</span><span class="p">,</span><span class="w"> </span><span class="nt">"password"</span><span class="p">:</span><span class="w"> </span><span class="s2">"str"</span><span class="w"> </span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">],</span><span class="w">
|
||||
</span><span class="nt">"random"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"str"</span><span class="p">],</span><span class="w">
|
||||
</span><span class="nt">"link"</span><span class="p">:</span><span class="w"> </span><span class="s2">"url"</span><span class="w">
|
||||
</span><span class="nt">"random"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"match(^\w*$)"</span><span class="p">],</span><span class="w">
|
||||
</span><span class="nt">"link"</span><span class="p">:</span><span class="w"> </span><span class="s2">"url"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"size"</span><span class="p">:</span><span class="w"> </span><span class="s2">"int(5,20)"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"count"</span><span class="p">:</span><span class="w"> </span><span class="s2">"float"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre>
|
||||
</div>
|
||||
|
@ -303,6 +325,45 @@ CMD [ "/run.sh" ]
|
|||
<li>port</li>
|
||||
<li>match(REGEX)</li>
|
||||
</ul>
|
||||
<h2><a class="title-link" name="add-on-extended-build" href="#add-on-extended-build"></a> Add-on extended build</h2>
|
||||
<p>Additional build options for an add-on is stored in <code class="highlighter-rouge">build.json</code>. This file will be read from our build systems.</p>
|
||||
<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nt">"build_from"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nt">"armhf"</span><span class="p">:</span><span class="w"> </span><span class="s2">"homeassistant/armhf-base:latest"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nt">"squash"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"args"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nt">"my_build_arg"</span><span class="p">:</span><span class="w"> </span><span class="s2">"xy"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Key</th>
|
||||
<th>Required</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>build_from</td>
|
||||
<td>no</td>
|
||||
<td>A dictionary with the hardware architecture as the key and the base Docker image as value.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>squash</td>
|
||||
<td>no</td>
|
||||
<td>Default <code class="highlighter-rouge">False</code>. Be carfully with this option, you can not use the image for caching stuff after that!</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>args</td>
|
||||
<td>no</td>
|
||||
<td>Allow to set additional Docker build arguments as a dictionary.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</article>
|
||||
</div>
|
||||
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
|
||||
|
|
|
@ -92,27 +92,16 @@
|
|||
</span><span class="err">}</span><span class="w">
|
||||
</span></code></pre>
|
||||
</div>
|
||||
<p>You can use <code class="highlighter-rouge"><span class="p">{</span><span class="err">arch</span><span class="p">}</span></code> inside the image name to support multiple architectures with 1 configuration file. It will be replaced with the architecture of the user when we load the image.</p>
|
||||
<p>Hass.io assumes that the <code class="highlighter-rouge">master</code> branch of your add-on repository matches the latest tag on Docker Hub. When you’re building a new version, it’s suggested that you use another branch, ie <code class="highlighter-rouge">build</code>. After you push the add-on to <a href="https://hub.docker.com/">Docker Hub</a>, you can merge this branch to master.</p>
|
||||
<p>You can use <code class="highlighter-rouge"><span class="p">{</span><span class="err">arch</span><span class="p">}</span></code> inside the image name to support multiple architectures with 1 configuration file. It will be replaced with the architecture of the user when we load the image. If you use <code class="highlighter-rouge">Buildargs</code> you can use the <code class="highlighter-rouge">build.json</code> to overwrite our default args.</p>
|
||||
<p>Hass.io assumes that the <code class="highlighter-rouge">master</code> branch of your add-on repository matches the latest tag on Docker Hub. When you’re building a new version, it’s suggested that you use another branch, ie <code class="highlighter-rouge">build</code> or do it with a PR on GitHub. After you push the add-on to <a href="https://hub.docker.com/">Docker Hub</a>, you can merge this branch to master.</p>
|
||||
<h2><a class="title-link" name="custom-add-ons" href="#custom-add-ons"></a> Custom Add-ons</h2>
|
||||
<p>You need a Docker Hub account to make your own add-ons. Download our <a href="https://github.com/home-assistant/hassio-build/tree/master/build-scripts/addons">build script</a> and run one of the following commands.</p>
|
||||
<p>You need a Docker Hub account to make your own add-ons. You can build your docker images with docker <code class="highlighter-rouge">build</code> command or use our script that make it simple. Pull our <a href="https://github.com/home-assistant/hassio-build/tree/master/builder">builder docker engine</a> and run one of the following commands.</p>
|
||||
<p>For a git repository:</p>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="c"># Test only:</span>
|
||||
./create_hassio_addon.sh -a amd64 -s addon-slug -r https://github.com/xy/addons -b branchname
|
||||
|
||||
<span class="c"># push to docker hub:</span>
|
||||
./create_hassio_addon.sh -a amd64 -s addon-slug -r https://github.com/xy/addons -b branchname -p
|
||||
|
||||
<span class="c"># create for all supported arch:</span>
|
||||
./create_addon_all.sh -s addon-slug -r https://github.com/xy/addons -b branchname -p
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>docker run --rm --privileged -v ~/.docker:/root/docker homeassistant/amd64-builder --all -t addon-folder -r https://github.com/xy/addons -b branchname
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>For a local repository:</p>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="c"># Test only:</span>
|
||||
./create_hassio_addon.sh -a amd64 -s addon-slug -l /home/xy/my_local_repo
|
||||
|
||||
<span class="c"># push to docker hub:</span>
|
||||
./create_hassio_addon.sh -a amd64 -s addon-slug -l /home/xy/my_local_repo -p
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>docker run --rm --privileged -v ~/.docker:/root/docker -v /my_addon:/data homeassistant/amd64-builder --all -t /data
|
||||
</code></pre>
|
||||
</div>
|
||||
</article>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>Local add-on testing - Home Assistant</title>
|
||||
<meta name="author" content="Home Assistant">
|
||||
<meta name="description" content="Instructions how to test your add-on locally.">
|
||||
<meta name="description" content="Instructions on how to test your add-on locally.">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="canonical" href="https://home-assistant.io/developers/hassio/addon_testing/">
|
||||
<meta property="fb:app_id" content="338291289691179">
|
||||
|
@ -16,12 +16,12 @@
|
|||
<meta property="og:site_name" content="Home Assistant">
|
||||
<meta property="og:url" content="https://home-assistant.io/developers/hassio/addon_testing/">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:description" content="Instructions how to test your add-on locally.">
|
||||
<meta property="og:description" content="Instructions on how to test your add-on locally.">
|
||||
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:site" content="@home_assistant">
|
||||
<meta name="twitter:title" content="Local add-on testing">
|
||||
<meta name="twitter:description" content="Instructions how to test your add-on locally.">
|
||||
<meta name="twitter:description" content="Instructions on how to test your add-on locally.">
|
||||
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
|
||||
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
|
||||
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
|
||||
|
@ -76,19 +76,19 @@
|
|||
<hr class="divider">
|
||||
<p>The fastest way to develop add-ons is by adding them to your local add-on repository. To access your local add-on repository, install either the <a href="/addons/samba/">Samba add-on</a> or <a href="/addons/ssh/">SSH add-on</a>.</p>
|
||||
<p>Right now add-ons will work with images that are stored on Docker Hub (using <code class="highlighter-rouge">image</code> from add-on config). Without <code class="highlighter-rouge">image</code> inside local add-ons repository it to be built on the device.</p>
|
||||
<h2><a class="title-link" name="local-run" href="#local-run"></a> Local run</h2>
|
||||
<p>You can build an try the addon on your developer machine also. Move all addon stuff into a temp folder. Replace in the Dockerfile <code class="highlighter-rouge">%%BASE_IMAGE%%</code> with:</p>
|
||||
<h2><a class="title-link" name="local-build" href="#local-build"></a> Local build</h2>
|
||||
<p>You can build an try the addon on your developer machine also. Move all addon stuff into a temp folder. If you use <code class="highlighter-rouge">FROM $BUILD_FROM</code> you need set a base image with build args. Normally you can use follow base images:</p>
|
||||
<ul>
|
||||
<li>armhf: <code class="highlighter-rouge">homeassistant/armhf-base:latest</code></li>
|
||||
<li>aarch64: <code class="highlighter-rouge">homeassistant/aarch64-base:latest</code></li>
|
||||
<li>amd64: <code class="highlighter-rouge">homeassistant/amd64-base:latest</code></li>
|
||||
<li>i386: <code class="highlighter-rouge">homeassistant/i386-base:latest</code></li>
|
||||
</ul>
|
||||
<p>Add also a <code class="highlighter-rouge">LABEL io.hass.version="xy"</code> into your dockerfile.
|
||||
Use <code class="highlighter-rouge">docker</code> to build the test addon: <code class="highlighter-rouge">docker build -t local/my-test-addon .</code></p>
|
||||
<p>Use <code class="highlighter-rouge">docker</code> to build the test addon: <code class="highlighter-rouge">docker build --build-arg BUILD_FROM="homeassistant/amd64-base:latest" -t local/my-test-addon .</code></p>
|
||||
<h2><a class="title-link" name="local-run" href="#local-run"></a> Local run</h2>
|
||||
<p>Create a new folder for data and add a test <em>options.json</em> file. After that you can run your add-on with: <code class="highlighter-rouge">docker run --rm -v /tmp/my_test_data:/data -p PORT_STUFF_IF_NEEDED local/my-test-addon</code></p>
|
||||
<h2><a class="title-link" name="logs" href="#logs"></a> Logs</h2>
|
||||
<p>All stdout and stderr is redirected to the Docker logs. The logs can be fetched from the add-on page inside the Hass.io panel in Home Assistant.</p>
|
||||
<p>All stdout and stderr are redirected to the Docker logs. The logs can be fetched from the add-on page inside the Hass.io panel in Home Assistant.</p>
|
||||
</article>
|
||||
</div>
|
||||
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
|
||||
|
|
|
@ -94,7 +94,8 @@ Once you SSH into your Hass.io box, you have access to your add-ons in “/addon
|
|||
<li>Inside that directory create three files.</li>
|
||||
</ul>
|
||||
<p><code class="highlighter-rouge">Dockerfile</code>:</p>
|
||||
<div class="highlighter-rouge"><pre class="highlight"><code>FROM %%BASE_IMAGE%%
|
||||
<div class="highlighter-rouge"><pre class="highlight"><code>ARG BUILD_FROM
|
||||
FROM $BUILD_FROM
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue