From 9de1129bf72f0db2a7d698f94aba4b6e3e126a9c Mon Sep 17 00:00:00 2001 From: Marcel Apfelbaum Date: Wed, 25 Aug 2021 19:53:21 +0000 Subject: [PATCH] osbuilder: Fix rootfs-builder when running in VMs The script runs apt sync at some point which scans all possible fds in order to close them. The operation is incredibly slow on VMs and may lead to build timeouts. Fix it by limiting the container runtime fds to a sane limit. Fixes: #2510 Signed-off-by: Marcel Apfelbaum --- tools/osbuilder/rootfs-builder/rootfs.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/osbuilder/rootfs-builder/rootfs.sh b/tools/osbuilder/rootfs-builder/rootfs.sh index b63567ad5d..44fdab42ea 100755 --- a/tools/osbuilder/rootfs-builder/rootfs.sh +++ b/tools/osbuilder/rootfs-builder/rootfs.sh @@ -373,6 +373,8 @@ build_rootfs_distro() docker_run_args="" docker_run_args+=" --rm" + # apt sync scans all possible fds in order to close them, incredibly slow on VMs + docker_run_args+=" --ulimit nofile=262144:262144" docker_run_args+=" --runtime ${DOCKER_RUNTIME}" if [ -z "${AGENT_SOURCE_BIN}" ] ; then