Don't cache Docker builds when they use git clone

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
Aurélien Bompard
2020-09-18 11:05:09 +02:00
parent 3bc4b73f4f
commit 266e030439
3 changed files with 6 additions and 2 deletions

View File

@@ -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') }} && \

View File

@@ -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

View File

@@ -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