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.
- Why is the docker not running as root inside the container?
- 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.