Repository navigation
Engine: images list newest first, and a missing working directory is made for non-root and read-only containers - #403
Merged
Conversation
…made for non-root and read-only containers
This was referenced Nov 16, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small Docker compatibility fixes in the engine:
docker imageslists the newest image first, as Docker does. Fixes Image list order differs from Docker Engine: older images appear first #364.--read-only, as with Docker. Kiri creates the missing directory as root, mode 0755, before it switches user and before the root goes read-only. The non-root case was breaking DDEV's web container. Fixes Non-root container with a missing WorkingDir fails to start (os error 2); breaks DDEV #370.Motivation
docker imagesas the newest got the wrong image.WorkingDir(mkdir -p), but only after it had switched to the container's user. A non-root user can't create directories under/, so the start failed withworking directory: No such file or directoryand exit code 127. DDEV'sddev-webserverhits this.Changes
crates/kiri/src/daemon/api.rs:images()sorts byCreated, newest first.crates/kiri-init/src/linux/container.rs: a newmake_workdir()runs right afterpivot_root, while the process is still root and before the read-only remount. It creates a missing working directory with mode 0755, owned by root, as Docker leaves it. The existing fallback after the user switch stays for exec.tests/e2e.sh: addsimages-newest-first,workdir-created-nonroot,workdir-created-nonroot-mode,workdir-created-readonlyandworkdir-created-readonly-nonroot.Behaviour changes
docker imagesandGET /images/jsonreturn 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.docker run --read-only -w /missing/dir …(root or not) now starts too. The root is still read-only: writing anywhere else in it fails as before.Testing
Replaces #400, adding the
--read-onlycase.Both fixes were checked against main on all three systems, together with the open PRs for the same release (#392, #393, #372):
--read-onlyruns start in a755 rootdirectory, while--read-onlystill refuses writes to the root. Fulltests/e2e.sh: no test fails on this branch that passes on main.tests/wsl.sh x86_64on the WSL 2 kernel): 21/21 pass on both main and the branch. The same checks, including the read-only ones, give the same results as on Linux.cargo test -p kiripasses.cargo clippyshows no new warnings on the host or the Linux target.Checklist
tests/e2e.sh)