From 5f5413e804a4cca38589b51409511029734992ea Mon Sep 17 00:00:00 2001 From: Adrian Villin Date: Fri, 20 Mar 2026 10:21:45 -0400 Subject: [PATCH] cache "RUN apt..." layers in Dockerfiles - can be overridden with NO_CACHE=true Signed-off-by: Adrian Villin --- common.mk | 3 +++ vpp-manager/images/ubuntu/Dockerfile | 6 +++--- vpp-manager/images/ubuntu/Dockerfile.debug | 6 +++--- vpp-manager/images/vclsidecar/Dockerfile | 6 +++--- vpp-manager/images/vclsidecar/Dockerfile.debug | 6 +++--- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/common.mk b/common.mk index 37370408..aa06fc18 100644 --- a/common.mk +++ b/common.mk @@ -55,3 +55,6 @@ DOCKER_BUILD_ARGS = --network=host DOCKER_BUILD_ARGS += --build-arg http_proxy=${DOCKER_BUILD_PROXY} DOCKER_BUILD_ARGS += --build-arg https_proxy=${DOCKER_BUILD_PROXY} DOCKER_BUILD_ARGS += --build-arg GIT_COMMIT="$(shell git log -1 --oneline)" +ifeq (${NO_CACHE},true) + DOCKER_BUILD_ARGS += --no-cache +endif diff --git a/vpp-manager/images/ubuntu/Dockerfile b/vpp-manager/images/ubuntu/Dockerfile index e7fcaf95..eab1d9bd 100644 --- a/vpp-manager/images/ubuntu/Dockerfile +++ b/vpp-manager/images/ubuntu/Dockerfile @@ -2,9 +2,6 @@ FROM ubuntu:22.04 LABEL maintainer="nskrzypc@cisco.com" -ARG GIT_COMMIT=unknown -LABEL git-commit=$GIT_COMMIT - RUN apt-get update \ && apt-get install -y openssl libapr1 libnuma1 \ libmbedcrypto7 libmbedtls14 libmbedx509-1 libsubunit0 \ @@ -13,6 +10,9 @@ RUN apt-get update \ gdb \ && rm -rf /var/lib/apt/lists/* +ARG GIT_COMMIT=unknown +LABEL git-commit=$GIT_COMMIT + # set work directory WORKDIR /root/ diff --git a/vpp-manager/images/ubuntu/Dockerfile.debug b/vpp-manager/images/ubuntu/Dockerfile.debug index c6f3472a..1e24fe8a 100644 --- a/vpp-manager/images/ubuntu/Dockerfile.debug +++ b/vpp-manager/images/ubuntu/Dockerfile.debug @@ -2,9 +2,6 @@ FROM ubuntu:22.04 LABEL maintainer="nskrzypc@cisco.com" -ARG GIT_COMMIT=unknown -LABEL git-commit=$GIT_COMMIT - RUN apt-get update \ && apt-get install -y openssl libapr1 libnuma1 \ libmbedcrypto7 libmbedtls14 libmbedx509-1 libsubunit0 \ @@ -13,6 +10,9 @@ RUN apt-get update \ gdb \ && rm -rf /var/lib/apt/lists/* +ARG GIT_COMMIT=unknown +LABEL git-commit=$GIT_COMMIT + # set work directory WORKDIR /root/ diff --git a/vpp-manager/images/vclsidecar/Dockerfile b/vpp-manager/images/vclsidecar/Dockerfile index 4f7e1ba4..d77536f4 100644 --- a/vpp-manager/images/vclsidecar/Dockerfile +++ b/vpp-manager/images/vclsidecar/Dockerfile @@ -1,8 +1,5 @@ FROM ubuntu:22.04 -ARG GIT_COMMIT=unknown -LABEL git-commit=$GIT_COMMIT - RUN apt update && apt install -y \ libunwind8 \ libssh-4 \ @@ -10,6 +7,9 @@ RUN apt update && apt install -y \ && apt clean \ && rm -rf /var/lib/apt/lists/* +ARG GIT_COMMIT=unknown +LABEL git-commit=$GIT_COMMIT + ADD artifacts/release/libvppcom* /usr/local/lib/ ADD artifacts/release/libvppinfra* /usr/local/lib/ ADD artifacts/release/libvlibmemoryclient* /usr/local/lib/ diff --git a/vpp-manager/images/vclsidecar/Dockerfile.debug b/vpp-manager/images/vclsidecar/Dockerfile.debug index be488644..235d1b8f 100644 --- a/vpp-manager/images/vclsidecar/Dockerfile.debug +++ b/vpp-manager/images/vclsidecar/Dockerfile.debug @@ -1,8 +1,5 @@ FROM ubuntu:22.04 -ARG GIT_COMMIT=unknown -LABEL git-commit=$GIT_COMMIT - RUN apt update && apt install -y \ libunwind8 \ libssh-4 \ @@ -10,6 +7,9 @@ RUN apt update && apt install -y \ && apt clean \ && rm -rf /var/lib/apt/lists/* +ARG GIT_COMMIT=unknown +LABEL git-commit=$GIT_COMMIT + ADD artifacts/debug/libvppcom* /usr/local/lib/ ADD artifacts/debug/libvppinfra* /usr/local/lib/ ADD artifacts/debug/libvlibmemoryclient* /usr/local/lib/