From 494c154b876333b3fdc800c242bb0110ce140115 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Wed, 28 May 2025 14:41:52 +0200 Subject: [PATCH 1/2] imagefiles/entrypoint.sh: Remove sync call This slows down the container startup for what appears to be no good reason. This workaround was added in 2016: dd9d902538b350a7388525e786db99be10b4f6a5 , see also https://github.com/moby/moby/issues/13594#issuecomment-262441366 , and hopefully AUFS has been fixed by now. --- imagefiles/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imagefiles/entrypoint.sh b/imagefiles/entrypoint.sh index 1e2bca7..14ee65b 100755 --- a/imagefiles/entrypoint.sh +++ b/imagefiles/entrypoint.sh @@ -38,7 +38,7 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then # Enable passwordless sudo capabilities for the user chown root:$BUILDER_GID "$(which gosu)" - chmod +s "$(which gosu)"; sync + chmod +s "$(which gosu)" # Execute project specific pre execution hook if [[ -e /work/.dockcross ]]; then From 27e0cf6c7801ae455df28fe09afcd482866b5198 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Wed, 28 May 2025 15:31:51 +0200 Subject: [PATCH 2/2] imagefiles/entrypoint.sh: Move rust/cargo directories Presumably we do not need those as root. --- imagefiles/entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imagefiles/entrypoint.sh b/imagefiles/entrypoint.sh index 14ee65b..a1bc6a2 100755 --- a/imagefiles/entrypoint.sh +++ b/imagefiles/entrypoint.sh @@ -28,6 +28,9 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then useradd -o -m -g "$BUILDER_GID" -u "$BUILDER_UID" "$BUILDER_USER" 2> /dev/null export HOME=/home/${BUILDER_USER} shopt -s dotglob + # Move rustup/cargo directories as they are large, and not needed as root + mv -t $HOME/ /root/.rustup /root/.cargo + # Copy the rest cp -r /root/* $HOME/ chown -R $BUILDER_UID:$BUILDER_GID $HOME