2

I am trying to install Docker daemon as non root user, following this guide: https://docs.docker.com/engine/security/rootless/

First, I removed the existing rootful docker daemon.

Then I created a user called docker-user and made it a member of docker group

Then I switched to shell for that docker-user like so:

sudo -iu docker-user

And ran the rootless docker installation script given at the link above.

Script output:

docker-user@ubuntu:~$ curl -fsSL https://get.docker.com/rootless | sh
# Installing stable version 19.03.8
# Existing rootless Docker detected at /home/docker-user/bin/dockerd
# systemd not detected, dockerd daemon needs to be started manually

/home/docker-user/bin/dockerd-rootless.sh --experimental --storage-driver vfs

# Docker binaries are installed in /home/docker-user/bin
# Make sure the following environment variables are set (or add them to ~/.bashrc):

export DOCKER_HOST=unix:///tmp/docker-1003/docker.sock

Looking at the script, the line systemd not detected, dockerd daemon needs to be started manually is output if systemctl --user daemon-reload falis

The output of systemctl --user daemon-reload is

docker-user@ubuntu:~$ systemctl --user daemon-reload
Failed to connect to bus: No such file or directory

I don't want to start docker manually, it should run as a service like the usual docker installation. As per the guide, I should be able to run it as a service. What am I doing wrong?

  • The Failed to connect to bus message is a bit misleading - the acutal problem is missing root permissions to run daemon-reload. – Panki May 19 at 14:12
  • But this user should not need root permission. It is not clear which user this command should be run as. I was assuming it is the non-root user. – Dojo May 19 at 14:17
  • What distro are you setting this up on? – Panki May 19 at 14:17
  • Tried with Ubuntu 18.04 and then with a fresh Ubuntu 20.04 VM – Dojo May 19 at 14:46
0

You need to login via ssh as the non-root user and then run the script.

sudo -iu docker-user

ssh docker-user@hostname

(docker-user is an example, use any non root user that exists on the target system)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.