From e919a373097406eaf9821312747b062e8a69a1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Molinero=20Fern=C3=A1ndez?= Date: Fri, 12 Jun 2020 00:45:15 +0200 Subject: [PATCH] Omit /dev/, /proc/, /sys/ and /run/ directories --- packer/build.pkr.hcl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packer/build.pkr.hcl b/packer/build.pkr.hcl index 72fc7b5..9547560 100644 --- a/packer/build.pkr.hcl +++ b/packer/build.pkr.hcl @@ -88,7 +88,10 @@ build { rm -f /etc/ssh/ssh_host_*key* rm -f /etc/wireguard/*-*key /etc/wireguard/*-iface find /var/lib/apt/lists/ -mindepth 1 -delete - find / -type f -regex '.+\.\(dpkg\|ucf\)-\(old\|new\|dist\)' -delete + find / -type f -regextype egrep \ + -regex '.+\.(dpkg|ucf)-(old|new|dist)' \ + -not -regex '/(dev|proc|sys|run)/.*' \ + -delete EOF ] }