Interview Prep/Docker/Security, rootless, Podman and containerd

Image runs fine as root but fails as non-root (`EACCES` creating `/app/.cache` or `/.npm`).

BeginnerTroubleshootingSecurity, rootless, Podman and containerd
Answer

Likely causes → Home/cache directories not writable by the non-root UID; no passwd entry for arbitrary UIDs.

Diagnose → docker run --user 10001 --rm image sh -c 'id; echo $HOME; touch $HOME/x'.

Fix → chown dirs at build, set HOME=/tmp or a writable path, npm_config_cache=/tmp/.npm.

Prevent → Test with the production user and read-only FS.

All Docker questions Roadmap: Docker & containers

More on Security, rootless, Podman and containerd