Skip to content

Engine: images list newest first, and a non-root container gets its missing working directory - #400

Closed
libracoder wants to merge 1 commit into
mainfrom
engine-api-batch1
Closed

libracoder wants to merge 1 commit into
mainfrom
engine-api-batch1

Conversation

@libracoder

@libracoder libracoder commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two small Docker compatibility fixes in the engine:

Motivation

Changes

  • crates/kiri/src/daemon/api.rs: images() sorts by Created, newest first.
  • crates/kiri-init/src/linux/container.rs: in finish_child(), for a non-root user, a missing working directory is created while the process is still root. It gets mode 0755 and stays owned by root, as Docker leaves it. Root containers keep the existing path.
  • tests/e2e.sh: adds images-newest-first, workdir-created-nonroot and workdir-created-nonroot-mode.

Behaviour changes

  • docker images and GET /images/json return images newest first. The window sorts its own list, so it looks the same.
  • docker run -u 1000:1000 -w /missing/dir … now starts, inside /missing/dir, which is owned by root with mode 0755. Before, it exited 127.

Testing

Both fixes were checked against main on all three systems, together with the open PRs for the same release (#392, #393, #372):

  • Linux (engine in a Linux container, kernel 6.18): on main, images come oldest first and the non-root run exits 127. On this branch, images come newest first, and the run prints /made/for/1000 with 755 root. Full tests/e2e.sh: no test fails on this branch that passes on main.
  • Windows / WSL 2 (tests/wsl.sh x86_64 on the WSL 2 kernel): 21/21 pass on both main and the branch. The checks give the same results as on Linux.
  • macOS (Apple silicon, Kiri's VM): the same checks give the same results.
  • Unit tests: cargo test -p kiri passes. cargo clippy shows no new warnings on the host or the Linux target.

Checklist

  • Works on macOS, Linux and Windows (WSL 2)
  • Tests added (tests/e2e.sh)
  • No new warnings

@libracoder

Copy link
Copy Markdown
Owner Author

Replaced by #403, which also makes the missing working directory for --read-only containers.

@libracoder libracoder closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

1 participant