Skip to content

Commit c752b36

Browse files
authored
docker: Increase tmpfs size, print usage statistics at the end (#14)
At the time of writing, build of a recent LLVM commit inside an ubuntu:25.10 container takes 1G under /opt/llvm-pauth and 4.7G under /repo/build (or 1.3G and 5.2G, respectively, with assertions enabled).
1 parent b7ab541 commit c752b36

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ build_in_docker() {
106106
--volume "$ROOT/src:$SRC_DIR:ro" \
107107
--volume "$ROOT/tmp:/tmp:rw" \
108108
--tmpfs "$DOCKER_BUILD_INSTALL_DIR:rw,exec,size=2G" \
109-
--tmpfs "$BUILD_TMP:rw,exec,size=5G" \
109+
--tmpfs "$BUILD_TMP:rw,exec,size=8G" \
110110
"$DOCKER_IMAGE_NAME" "$REPO_ROOT/scripts/build-in-docker.sh"
111111
}
112112

scripts/build-in-docker.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ export REPO_ROOT="$(pwd)/.."
1212
. ./global-vars
1313
export INSTALL_DIR="$DOCKER_BUILD_INSTALL_DIR"
1414

15+
on_exit() {
16+
# Print usage statistics for Docker volumes mounted into this container.
17+
# Omit several unrelated mount points for readability.
18+
df -h | grep -vE ' /(dev|etc|proc|sys)'
19+
}
20+
# Unconditionally print the statistics - whether the script terminates normally
21+
# or due to a subcommand error (as requested by "set -e").
22+
trap on_exit EXIT
23+
1524
if ! ./build-all.sh; then
1625
echo "Containerized build failed - $BUILD_TMP is discarded automatically."
1726
exit 1

0 commit comments

Comments
 (0)