Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is DOCKER_HOST environment variable considered? #79

Closed
ilndinesh opened this issue Oct 3, 2018 · 4 comments
Closed

Is DOCKER_HOST environment variable considered? #79

ilndinesh opened this issue Oct 3, 2018 · 4 comments

Comments

@ilndinesh
Copy link

No description provided.

@mviereck
Copy link
Owner

mviereck commented Oct 3, 2018

I am not sure about your question. You can set DOCKER_HOST before starting x11docker, and it will take effect.
E.g. env DOCKER_HOST=mydockerhost x11docker [...]
Or:

export DOCKER_HOST=mydockerhost
x11docker [...]

If you encounter an issue, please provide a description. Should x11docker itself do something special?

@ilndinesh
Copy link
Author

Thanks for more detail. If I encounter issue again, I will create another issue with more details and description.

@mviereck
Copy link
Owner

mviereck commented Oct 8, 2018

Depending on system setup x11docker runs docker with e.g. su, sudo or pkexec. (Compare option --pw). Maybe some environment variables get lost.
I just checked:

$ export DOCKER_HOST=xy
$ env | grep DOCKER
DOCKER_HOST=xy
$ sudo env | grep DOCKER
$
$ sudo -E env | grep DOCKER
DOCKER_HOST=xy
$ su -c env | grep DOCKER
Passwort: 
DOCKER_HOST=xy
$ su -c env | grep DOCKER
Passwort: 
DOCKER_HOST=xy
$ pkexec env | grep DOCKER
$

sudo env and pkexec env do not show DOCKER_HOST.

It seems x11docker should check for DOCKER_HOST and set it again.
Are there other important variables x11docker should regard?
I found some more DOCKER_* variables here.

I will include a check for those variables in the next update.

@mviereck mviereck reopened this Oct 8, 2018
@mviereck
Copy link
Owner

mviereck commented Oct 8, 2018

I will include a check for those variables in the next update.

Latest master version exports all DOCKER_* variables ahead of running docker.

If they get lost e.g. because of running sudo x11docker or pkexec x11docker, there is not much I can do.
If sudo on your system allows option -E, you can run sudo -E x11docker to preserve environment variables.
If you want to run with pkexec you can use pkexec env DOCKER_HOST=$DOCKER_HOST x11docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants