0

From a non-root testuser which is a non sudo account, I have installed a rootless docker following the instruction here (Ubuntu without package).

When I start a container and go inside it by running docker exec -it my_container bash then checking whoami I get: root instead of testuser. In addition, files and folders which are named volumes owned by testuser are not mounted and owned by root. The docker daemon is running from testuser since I am running that daemon from a systemctl --user.

This is quite confusing.

  1. Why is the docker not running as root inside the container?
  2. Why are the mounted volumes all of a sudden with a different ownership?

I checked this answer here, but it notes that when the daemon is running as root - that's normal, however that's not the case with my rootless setup.

1 Answer 1

0

This is because the container is running under a different user namespace. root (0) in the container is probably mapped to your user ID on the host.

https://docs.docker.com/engine/security/userns-remap/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .