From a1a3fdc1b54baf62f234ddc9dac4906e30eb5d11 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Thu, 18 Jun 2026 17:16:08 +0200 Subject: 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 --- docker/openvswitch/openvswitch-base/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docker/openvswitch/openvswitch-base') diff --git a/docker/openvswitch/openvswitch-base/Dockerfile.j2 b/docker/openvswitch/openvswitch-base/Dockerfile.j2 index 4400d4f1e..44d8df41c 100644 --- a/docker/openvswitch/openvswitch-base/Dockerfile.j2 +++ b/docker/openvswitch/openvswitch-base/Dockerfile.j2 @@ -1,6 +1,6 @@ FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }} {% block labels %} -LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" {% endblock %} {% block openvswitch_base_header %}{% endblock %} -- cgit v1.2.3