From e57f90cb781481121234febf894034173659a774 Mon Sep 17 00:00:00 2001 From: magrhino <12738722+magrhino@users.noreply.github.com> Date: Fri, 16 Oct 2026 17:35:33 -0500 Subject: [PATCH 1/3] test(e2e): write stack Compose files from a container so macOS VMs read them whole On macOS Docker VMs (seen with OrbStack 2.2.4), once a container has written a bind-mounted file, later host-side rewrites of that file can stay invisible to new containers for a few seconds. The stack-recreate scenario rewrote docker-compose.yml from the host right after the digest-pin updater had rewritten it from a container, so the next updater read the new file cut off at the old size, Compose rejected it, and the runtime-state preflight failed closed. Write the stack Compose files from a container as the host user, like write_volume_file does for volumes. --- tests/e2e-docker-compose.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/e2e-docker-compose.sh b/tests/e2e-docker-compose.sh index 34e7aded..ff682e36 100755 --- a/tests/e2e-docker-compose.sh +++ b/tests/e2e-docker-compose.sh @@ -402,9 +402,20 @@ prepare_images(){ run docker tag "$OLD_LOCAL_IMAGE" "$APP_IMAGE" } +# Write the Compose file from a container, as write_volume_file does. On macOS +# Docker VMs (seen with OrbStack), once a container has written a bind-mounted +# file, later host-side rewrites can stay invisible to new containers for a few +# seconds, so the updater would read the new contents cut off at the old size. +# Writing from a container keeps every write on the updater's side of the file +# share; running as the host user keeps the file owner unchanged. +write_stack_compose_file(){ + docker run -i --rm --user "$(id -u):$(id -g)" -v "$STACK_DIR:$STACK_DIR" "$IMAGE" \ + bash -c 'cat > "$1"' _ "$COMPOSE_FILE" +} + write_compose_file(){ mkdir -p "$STACK_DIR" - cat > "$COMPOSE_FILE" < "$COMPOSE_FILE" < "$COMPOSE_FILE" < "$COMPOSE_FILE" < "$COMPOSE_FILE" < Date: Fri, 16 Oct 2026 17:35:33 -0500 Subject: [PATCH 2/3] test(e2e): write stack Compose files from a container so macOS VMs read them whole On macOS Docker VMs (seen with OrbStack 2.2.4), once a container has written a bind-mounted file, later host-side rewrites of that file can stay invisible to new containers for a few seconds. The stack-recreate scenario rewrote docker-compose.yml from the host right after the digest-pin updater had rewritten it from a container, so the next updater read the new file cut off at the old size, Compose rejected it, and the runtime-state preflight failed closed. Write the stack Compose files from a container as the host user, like write_volume_file does for volumes. --- tests/e2e-docker-compose.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/e2e-docker-compose.sh b/tests/e2e-docker-compose.sh index 34e7aded..ff682e36 100755 --- a/tests/e2e-docker-compose.sh +++ b/tests/e2e-docker-compose.sh @@ -402,9 +402,20 @@ prepare_images(){ run docker tag "$OLD_LOCAL_IMAGE" "$APP_IMAGE" } +# Write the Compose file from a container, as write_volume_file does. On macOS +# Docker VMs (seen with OrbStack), once a container has written a bind-mounted +# file, later host-side rewrites can stay invisible to new containers for a few +# seconds, so the updater would read the new contents cut off at the old size. +# Writing from a container keeps every write on the updater's side of the file +# share; running as the host user keeps the file owner unchanged. +write_stack_compose_file(){ + docker run -i --rm --user "$(id -u):$(id -g)" -v "$STACK_DIR:$STACK_DIR" "$IMAGE" \ + bash -c 'cat > "$1"' _ "$COMPOSE_FILE" +} + write_compose_file(){ mkdir -p "$STACK_DIR" - cat > "$COMPOSE_FILE" < "$COMPOSE_FILE" < "$COMPOSE_FILE" < "$COMPOSE_FILE" < "$COMPOSE_FILE" < Date: Fri, 16 Oct 2026 17:41:04 -0500 Subject: [PATCH 3/3] test(e2e): write stack Compose files as the container's default user for rootless Docker --- tests/e2e-docker-compose.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/e2e-docker-compose.sh b/tests/e2e-docker-compose.sh index ff682e36..d98809c6 100755 --- a/tests/e2e-docker-compose.sh +++ b/tests/e2e-docker-compose.sh @@ -407,9 +407,12 @@ prepare_images(){ # file, later host-side rewrites can stay invisible to new containers for a few # seconds, so the updater would read the new contents cut off at the old size. # Writing from a container keeps every write on the updater's side of the file -# share; running as the host user keeps the file owner unchanged. +# share. The host creates the file once so it stays owned by the host user; the +# container runs as its default user, like the updater, so rootless Docker can +# write it, and truncating an existing file keeps that owner. write_stack_compose_file(){ - docker run -i --rm --user "$(id -u):$(id -g)" -v "$STACK_DIR:$STACK_DIR" "$IMAGE" \ + [[ -e "$COMPOSE_FILE" ]] || : > "$COMPOSE_FILE" + docker run -i --rm -v "$STACK_DIR:$STACK_DIR" "$IMAGE" \ bash -c 'cat > "$1"' _ "$COMPOSE_FILE" }