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 ] }