konstruktoid / ansible-role-docker-rootless

Ansible role to install a rootless Docker server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot connect to the rootless daemon via SSH due to missing DOCKER_HOST variable

linozen opened this issue · comments

{{ tools.context.actor }}: {{ tools.context.sha }}

When I am trying to connect to a rootless daemon via e.g. the Docker SDK for Python, I'm getting an error message if the DOCKER_HOST variable is not globally available on the host where the daemon is running. A simple fix would be to set this variable globally, e.g. in /etc/environment.

Please let me know if there is a more elegant solution or if this is out of scope.

Many thanks!

Hi, had a similar discussion in #12 (and the PR #13) and I'm not really a fan of setting DOCKER_HOST in /etc/environment or any global config files since we're trying to isolate as much as possible.
And that is will cause issues if multiple {{ docker_user }} and installations are used on the same host.

If you find it an acceptable situation, have a look at #13 and set the environment variables only for the user.

Your reasoning makes sense. Thanks for your feedback. Will close the issue now.