aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJoshua Harlow <jxharlow@godaddy.com>2016-12-15 13:50:39 -0800
committerJoshua Harlow <jxharlow@godaddy.com>2017-01-05 15:09:37 -0800
commit9b1e519267f022ceb3f920976591a8f8233addc4 (patch)
tree9e07f08556e02c65a76d188c264282a256cfcd62 /doc
parent96a604aa1133c04b1fd01ea3b355396ce18baf56 (diff)
downloadkolla-9b1e519267f022ceb3f920976591a8f8233addc4.tar.gz
kolla-9b1e519267f022ceb3f920976591a8f8233addc4.zip
Allow for image additions archives (as well as plugins)
It is quite useful to be able to add additional items (such as jenkins build information) into the image but the only way to do this seems to be via plugins archives. Using these for such information ends badly when building neutron (because those *plugin* archives need to contain setup.py files) so this proposes a new mechanism to put files that are not python plugins but are auxilary useful data to put in the image (such as the jenkins data mentioned above). Change-Id: Ica8b5750bd239e023f14225190e68dab75519d36
Diffstat (limited to 'doc')
-rw-r--r--doc/image-building.rst64
1 files changed, 63 insertions, 1 deletions
diff --git a/doc/image-building.rst b/doc/image-building.rst
index 9e8ac58f2..4fdea5c9d 100644
--- a/doc/image-building.rst
+++ b/doc/image-building.rst
@@ -267,7 +267,7 @@ image, add the following to the ``template-override`` file::
&& pip --no-cache-dir install networking-cisco
{% endblock %}
-Acute readers may notice there is one problem with this however. Assuming
+Astute readers may notice there is one problem with this however. Assuming
nothing else in the Dockerfile changes for a period of time, the above ``RUN``
statement will be cached by Docker, meaning new commits added to the Git
repository may be missed on subsequent builds. To solve this the Kolla build
@@ -309,6 +309,68 @@ The template now becomes::
pip --no-cache-dir install /plugins/*
{% endblock %}
+Additions Functionality
+-----------------------
+
+The Dockerfile customisation mechanism is also useful for adding/installing
+additions into images. An example of this is adding your jenkins job build
+metadata (say formatted into a jenkins.json file) into the image.
+
+The bottom of each Dockerfile contains two blocks, ``image_name_footer``, and
+``footer``. The ``image_name_footer`` is intended for image specific
+modifications, while the ``footer`` can be used to apply a common set of
+modifications to every Dockerfile.
+
+For example, to add the ``jenkins.json`` additions to the ``neutron_server``
+image, add the following to the ``template-override`` file::
+
+ {% extends parent_template %}
+
+ {% block neutron_server_footer %}
+ RUN cp /additions/jenkins/jenkins.json /jenkins.json
+ {% endblock %}
+
+Astute readers may notice there is one problem with this however. Assuming
+nothing else in the Dockerfile changes for a period of time, the above ``RUN``
+statement will be cached by Docker, meaning new commits added to the Git
+repository may be missed on subsequent builds. To solve this the Kolla build
+tool also supports cloning additional repositories at build time, which will be
+automatically made available to the build, within an archive named
+``additions-archive``.
+
+.. note::
+
+ The following is available for source build types only.
+
+To use this, add a section to ``/etc/kolla/kolla-build.conf`` in the following
+format::
+
+ [<image>-additions-<additions-name>]
+
+Where ``<image>`` is the image that the plugin should be installed into, and
+``<additions-name>`` is the chosen additions identifier.
+
+Continuing with the above example, add the following to
+``/etc/kolla/kolla-build.conf``::
+
+ [neutron-server-jenkins]
+ type = local
+ location = /path/to/your/jenkins/data
+
+The build will copy the directory, resulting in the following archive
+structure::
+
+ additions-archive.tar
+ |__ additions
+ |__jenkins
+
+The template now becomes::
+
+ {% block neutron_server_footer %}
+ ADD additions-archive /
+ RUN cp /additions/jenkins/jenkins.json /jenkins.json
+ {% endblock %}
+
Custom Repos
------------