Is this better than using emacs over SSH?
Could however be better from security perspective if you don't want to expose a shell and the whole filesystem to potentially untrusted computers.
[1] https://github.com/karlicoss/cloudmacs/blob/master/asEnvUser [2] https://security.stackexchange.com/a/153016
Although a section explaining how to build container that runs as non-root user in the first place (even though it requires modifying Dockerfile, I think) would be useful, so I'll add it, thanks!
Yep, potential kernel/Docker bugs would let you escape the sandbox, but I guess that's the risk I'm accepting.