I'm trying to install the docker daemon as a non-root user. I'm running this on RHEL 7.9.
Steps followed:
- Created a non-root user and switched to that user.
- Ran
curl -fsSL https://get.docker.com/rootless | sh
- Set below env variables:
export XDG_RUNTIME_DIR=/home/test/.docker/run; export PATH=/home/test/bin:$PATH; export DOCKER_HOST=unix:///home/test/.docker/run/docker.sock
- Finally, when trying to manually start the docker daemon, it's failing with below error:
PATH=/home/test/bin:/sbin:/usr/sbin:$PATH dockerd-rootless.sh
WARN[0000] The host root filesystem is mounted as "". Setting child propagation to "rslave" is not supported.
[rootlesskit:parent] error: failed to setup UID/GID map: newuidmap 666 [0 1003 1 1 296608 65536] failed: newuidmap: write to uid_map failed: Operation not permitted
: exit status 1
My goal with this exercise is to start the docker daemon on a host in unprivileged mode, and run a single container. That's all I need, but I wasn't able to find any other references to running the docker daemon as non-root user other than above instructions.
Can someone help me how I can resolve this issue? Also, if for my use case there's a better approach, please let me know. Appreciate your time!