diff options
| author | Jenkins <jenkins@review.openstack.org> | 2017-02-21 18:40:28 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-02-21 18:40:28 +0000 |
| commit | 6cf8dd5fe378abeb816736928001af970c067257 (patch) | |
| tree | 1e00dba9c5c5e09dfe7371a124607e17ad86ea7b /doc | |
| parent | 7450c32cd2708281a369935073cdd09074351f54 (diff) | |
| parent | 9b1e519267f022ceb3f920976591a8f8233addc4 (diff) | |
| download | kolla-6cf8dd5fe378abeb816736928001af970c067257.tar.gz kolla-6cf8dd5fe378abeb816736928001af970c067257.zip | |
Merge "Allow for image additions archives (as well as plugins)"
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/image-building.rst | 64 |
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 ------------ |
