Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions crates/preloop-orchestrator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1304,15 +1304,30 @@ fn docker_start_command() -> Vec<String> {
mkdir -p {DOCKER_DATA_ROOT}; \
modprobe overlay >/dev/null 2>&1 || true; \
modprobe fuse >/dev/null 2>&1 || true; \
# The krunfw guest kernel has fuse built in, but the VM boots
# /dev as a plain tmpfs with only the image's baked nodes, so
# /dev/fuse is missing and fuse-overlayfs (dockerd's fallback
# when its overlay probe fails) dies with 'fuse: device not
# found'). Create the node when the kernel supports fuse; dockerd
# then auto-picks fuse-overlayfs (CoW) on kernels whose overlay
# probe fails, and overlay2 on stock kernels where it succeeds.
if grep -q fuse /proc/filesystems; then \
[ -e /dev/fuse ] || mknod /dev/fuse c 10 229; \
fi; \
mkdir -p /tmp/.preloop-ovprobe; \
if mount -t overlay overlay -o lowerdir=/tmp:/usr /tmp/.preloop-ovprobe 2>/dev/null; then \
umount /tmp/.preloop-ovprobe 2>/dev/null || true; \
DRIVER=overlay2; \
DRIVER=; \
else \
DRIVER=vfs; \
# Overlay unusable (the krunfw kernel rejects the probe mount
# with EINVAL). Only force vfs when fuse is unavailable too —
# otherwise fuse-overlayfs auto-detects and works.
[ -e /dev/fuse ] || DRIVER=vfs; \
fi; \
rmdir /tmp/.preloop-ovprobe 2>/dev/null || true; \
printf '{{\"data-root\":\"{DOCKER_DATA_ROOT}\",\"storage-driver\":\"%s\"}}\\n' \"$DRIVER\" > /etc/docker/daemon.json; \
if [ -n \"$DRIVER\" ]; then \
printf '{{\"data-root\":\"{DOCKER_DATA_ROOT}\",\"storage-driver\":\"%s\"}}\\n' \"$DRIVER\" > /etc/docker/daemon.json; \
fi; \
Comment on lines +1328 to +1330

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High src/lib.rs:1111

When DRIVER is empty, this leaves stale /etc/docker/daemon.json untouched or creates no config, so Docker can retain an unusable storage-driver and use /var/lib/docker instead of /storage/docker. Write data-root unconditionally, and include storage-driver only when DRIVER is forced.

-             if [ -n "$DRIVER" ]; then \
-               printf '{{"data-root":"{DOCKER_DATA_ROOT}","storage-driver":"%s"}}\\n' "$DRIVER" > /etc/docker/daemon.json; \
-             fi; \
+             if [ -n "$DRIVER" ]; then \
+               printf '{{"data-root":"{DOCKER_DATA_ROOT}","storage-driver":"%s"}}\\n' "$DRIVER" > /etc/docker/daemon.json; \
+             else \
+               printf '{{"data-root":"{DOCKER_DATA_ROOT}"}}\\n' > /etc/docker/daemon.json; \
+             fi; \
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @crates/preloop-orchestrator/src/lib.rs around lines 1111-1113:

When `DRIVER` is empty, this leaves stale `/etc/docker/daemon.json` untouched or creates no config, so Docker can retain an unusable `storage-driver` and use `/var/lib/docker` instead of `/storage/docker`. Write `data-root` unconditionally, and include `storage-driver` only when `DRIVER` is forced.

start_dockerd() {{ \
rm -f /var/run/docker.pid; \
dockerd >/var/log/dockerd.log 2>&1 & \
Expand Down
Loading