Skip to content

Commit dca8462

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Add mechanism for patching files in containers"
2 parents 68fa7d3 + 11f65c6 commit dca8462

File tree

210 files changed

+610
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+610
-5
lines changed

doc/source/admin/image-building.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,59 @@ To remove a package from that list, say ``locales``, one would do:
301301
An example of this is the Grafana plugins, which are mentioned in the next
302302
section.
303303

304+
Patching customization
305+
----------------------
306+
307+
Kolla provides functionality to apply patches to Docker images during the build
308+
process. This allows users to modify existing files or add new ones as part of
309+
the image creation.
310+
311+
You need to define a ``patches_path`` in the ``[DEFAULT]`` section of
312+
the ``/etc/kolla/kolla-build.conf`` file. This directory will be used to store
313+
patches for the images.
314+
315+
.. path etc/kolla/kolla-build.conf
316+
.. code-block:: ini
317+
318+
[DEFAULT]
319+
patches_path = /path/to/your/patches
320+
321+
Create a directory for each image you want to patch, following a directory
322+
structure similar to the Debian patch quilt format. Refer to
323+
`quilt documentation <https://linux.die.net/man/1/quilt>`_. for more details.
324+
325+
- ``<patches_path>/image_name/`` : The directory for the specific image.
326+
- ``<patches_path>/image_name/some-patch`` : Contains the patch content.
327+
- ``<patches_path>/image_name/another-patch`` : Contains the patch content.
328+
- ``<patches_path>/image_name/series`` : Lists the order in which the patches
329+
will be applied.
330+
331+
For example, if you want to patch the ``nova-api`` image, the structure would
332+
look like this:
333+
334+
.. code-block:: console
335+
336+
/path/to/your/patches/nova-api/some-patch
337+
/path/to/your/patches/nova-api/another-patch
338+
/path/to/your/patches/nova-api/series
339+
340+
The ``series`` file should list the patches in the order they should be
341+
applied:
342+
343+
.. code-block:: console
344+
345+
some-patch
346+
another-patch
347+
348+
When the images are built using ``kolla-build``, the patches defined in the
349+
``patches_path`` will automatically be applied to the corresponding images.
350+
351+
After the patches are applied, Kolla stores information about the applied
352+
patches in ``/etc/kolla/patched``. The patch files themselves are stored
353+
in the ``/patches`` directory within the image. This allows you to track
354+
which patches have been applied to each image for debugging or
355+
verification purposes.
356+
304357
Grafana plugins
305358
^^^^^^^^^^^^^^^
306359

docker/aodh/aodh-api/Dockerfile.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
1010
COPY extend_start.sh /usr/local/bin/kolla_aodh_extend_start
1111
RUN chmod 644 /usr/local/bin/kolla_aodh_extend_start
1212

13+
{{ macros.kolla_patch_sources() }}
14+
1315
{% block aodh_api_footer %}{% endblock %}
1416
{% block footer %}{% endblock %}

docker/aodh/aodh-base/Dockerfile.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ RUN ln -s aodh-base-source/* aodh \
3434
&& touch /usr/local/bin/kolla_aodh_extend_start \
3535
&& chmod 644 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_aodh_extend_start
3636

37+
{{ macros.kolla_patch_sources() }}
38+
3739
{% block aodh_base_footer %}{% endblock %}

docker/aodh/aodh-evaluator/Dockerfile.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
77

88
{% import "macros.j2" as macros with context %}
99

10+
{{ macros.kolla_patch_sources() }}
11+
1012
{% block aodh_evaluator_footer %}{% endblock %}
1113
{% block footer %}{% endblock %}
1214

docker/aodh/aodh-expirer/Dockerfile.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
77

88
{% import "macros.j2" as macros with context %}
99

10+
{{ macros.kolla_patch_sources() }}
11+
1012
{% block aodh_expirer_footer %}{% endblock %}
1113
{% block footer %}{% endblock %}
1214

docker/aodh/aodh-listener/Dockerfile.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
77

88
{% import "macros.j2" as macros with context %}
99

10+
{{ macros.kolla_patch_sources() }}
11+
1012
{% block aodh_listener_footer %}{% endblock %}
1113
{% block footer %}{% endblock %}
1214

docker/aodh/aodh-notifier/Dockerfile.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
77

88
{% import "macros.j2" as macros with context %}
99

10+
{{ macros.kolla_patch_sources() }}
11+
1012
{% block aodh_notifier_footer %}{% endblock %}
1113
{% block footer %}{% endblock %}
1214

docker/barbican/barbican-api/Dockerfile.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ COPY extend_start.sh /usr/local/bin/kolla_barbican_extend_start
1111

1212
RUN chmod 644 /usr/local/bin/kolla_barbican_extend_start
1313

14+
{{ macros.kolla_patch_sources() }}
15+
1416
{% block barbican_api_footer %}{% endblock %}
1517
{% block footer %}{% endblock %}
1618

docker/barbican/barbican-base/Dockerfile.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ RUN ln -s barbican-base-source/* barbican \
3838
&& touch /usr/local/bin/kolla_barbican_extend_start \
3939
&& chmod 644 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_barbican_extend_start
4040

41+
{{ macros.kolla_patch_sources() }}
42+
4143
{% block barbican_base_footer %}{% endblock %}

docker/barbican/barbican-keystone-listener/Dockerfile.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
77

88
{% import "macros.j2" as macros with context %}
99

10+
{{ macros.kolla_patch_sources() }}
11+
1012
{% block barbican_keystone_listener_footer %}{% endblock %}
1113
{% block footer %}{% endblock %}
1214

0 commit comments

Comments
 (0)