From b8bbfbe22caf92edb262ee6453d2a94c130e3506 Mon Sep 17 00:00:00 2001 From: Seb Patane Date: Sat, 5 May 2018 07:08:12 +1000 Subject: [PATCH] Don't workaround non-overlay systems - It turns out that using this in a build step will needlessly copy all CACHE.DAT's to the next layer, since the `touch` is enough to make the filesystem think the files changed. - At least we can make this only happen on the filesystem that needs the workaround --- "dockerfile/Cach\303\251+SSH/ccontrol-wrapper.sh" | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git "a/dockerfile/Cach\303\251+SSH/ccontrol-wrapper.sh" "b/dockerfile/Cach\303\251+SSH/ccontrol-wrapper.sh" index 67aed86..ae4c661 100644 --- "a/dockerfile/Cach\303\251+SSH/ccontrol-wrapper.sh" +++ "b/dockerfile/Cach\303\251+SSH/ccontrol-wrapper.sh" @@ -2,7 +2,10 @@ # Work around a werid overlayfs bug where files don't open properly if they haven't been # touched first - see the yum-ovl plugin for a similar workaround -if [ "${1,,}" == "start" ]; then +df / | grep -q overlay +filesystemIsOverlay=$? + +if [ "${1,,}" == "start" ] && [ $filesystemIsOverlay -eq 0 ]; then find / -name CACHE.DAT -exec touch {} \; fi