From 266e0304399d9d2eabf276c5bde065404355a080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Fri, 18 Sep 2020 11:05:09 +0200 Subject: [PATCH] Don't cache Docker builds when they use git clone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- roles/openshift-apps/fasjson/templates/Dockerfile | 2 -- roles/openshift-apps/fasjson/templates/buildconfig.yml | 3 +++ roles/openshift-apps/ipsilon/templates/buildconfig.yml | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/openshift-apps/fasjson/templates/Dockerfile b/roles/openshift-apps/fasjson/templates/Dockerfile index 96979ed27a..d57445e9fa 100644 --- a/roles/openshift-apps/fasjson/templates/Dockerfile +++ b/roles/openshift-apps/fasjson/templates/Dockerfile @@ -28,8 +28,6 @@ RUN dnf install -y \ python3-wheel && \ dnf autoremove -y && \ dnf clean all -y -# Run a command with random content to prevent Docker from caching the git clone step. -RUN echo {{ now() }} RUN git clone https://github.com/fedora-infra/fasjson.git && \ pushd fasjson && \ git checkout {{ (env == 'production')|ternary('stable', 'staging') }} && \ diff --git a/roles/openshift-apps/fasjson/templates/buildconfig.yml b/roles/openshift-apps/fasjson/templates/buildconfig.yml index 301a8b2313..0d494b00bd 100644 --- a/roles/openshift-apps/fasjson/templates/buildconfig.yml +++ b/roles/openshift-apps/fasjson/templates/buildconfig.yml @@ -14,6 +14,9 @@ spec: {{ load_file('Dockerfile') | indent(6) }} strategy: type: Docker + dockerStrategy: + # Prevent Docker from caching the git clone step in the Dockerfile + noCache: true output: to: kind: ImageStreamTag diff --git a/roles/openshift-apps/ipsilon/templates/buildconfig.yml b/roles/openshift-apps/ipsilon/templates/buildconfig.yml index b8b37f17e1..063fa2a844 100644 --- a/roles/openshift-apps/ipsilon/templates/buildconfig.yml +++ b/roles/openshift-apps/ipsilon/templates/buildconfig.yml @@ -13,6 +13,9 @@ spec: {{ load_file('Dockerfile') | indent(6) }} strategy: type: Docker + dockerStrategy: + # Prevent Docker from caching the git clone step in the Dockerfile + noCache: true output: to: kind: ImageStreamTag