aboutsummaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
authorMichal Nasiadka <mnasiadka@gmail.com>2026-06-18 17:16:08 +0200
committerMichal Nasiadka <mnasiadka@gmail.com>2026-06-24 15:00:26 +0200
commita1a3fdc1b54baf62f234ddc9dac4906e30eb5d11 (patch)
treea4f88789a9ac039db65f9491751c75ca59cebb74 /doc/source
parenta437f0bd5f406bf1f82dfdf05c4dac16c02573ff (diff)
downloadkolla-a1a3fdc1b54baf62f234ddc9dac4906e30eb5d11.tar.gz
kolla-a1a3fdc1b54baf62f234ddc9dac4906e30eb5d11.zip
kolla-build: fix build-date LABEL invalidating Docker layer cache
The build-date label was rendered into a LABEL instruction on line 3 of every Dockerfile template, immediately after FROM. Because Docker invalidates the cache for a changed instruction and all subsequent layers, a date change caused a full rebuild of every image on each new calendar day, even when nothing else had changed. Fix this by removing build-date from the Dockerfile templates and applying it as a --label argument at build time via image.labels. Labels passed on the build command line are not part of the Dockerfile cache key, so the date is still recorded in the image metadata without affecting layer caching. Change-Id: I8ef0d85bab1a999a4d09f7cbf0c088ca00fdcf77 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/admin/image-building.rst2
-rw-r--r--doc/source/contributor/adding-a-new-image.rst2
2 files changed, 2 insertions, 2 deletions
diff --git a/doc/source/admin/image-building.rst b/doc/source/admin/image-building.rst
index 842198470..af59e4a2e 100644
--- a/doc/source/admin/image-building.rst
+++ b/doc/source/admin/image-building.rst
@@ -615,7 +615,7 @@ First, create a ``Dockerfile.j2`` template for the project.
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
{% block labels %}
- LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
+ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}"
{% endblock %}
{% block releaser_header %}{% endblock %}
diff --git a/doc/source/contributor/adding-a-new-image.rst b/doc/source/contributor/adding-a-new-image.rst
index 147d77ad9..995bf13c7 100644
--- a/doc/source/contributor/adding-a-new-image.rst
+++ b/doc/source/contributor/adding-a-new-image.rst
@@ -33,7 +33,7 @@ OpenStack project base image is as follows:
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
{% block labels %}
- LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
+ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}"
{% endblock %}
{% block << service >>_header %}{% endblock %}