manullay transmit env variables to selenium user in *debug*#131
manullay transmit env variables to selenium user in *debug*#1311 commit merged intoSeleniumHQ:masterfrom
Conversation
|
I have never run into this before so I can't really provide any good feedback on this. Is the reason for the change because we drop some values? Anybody else please? |
|
Yes, I must provide the http_proxy and https_proxy in my environment and those variables are lost in "debug mode" The way to reproduce it in a similar env is the following: # start a container with environment variable ANYTHING
$ docker run -it -e ANYTHING=123 ubuntu:14.04 bash
# it is available
root@f29746d3ae3d:/# env | grep ANYTHING
ANYTHING=123
# create a user seluser as in docker-selenium images
root@f29746d3ae3d:/# adduser seluser
Adding user 'seluser' ...
# sudo w/o any option: ANYTHING is not propagated
root@f29746d3ae3d:/# sudo -u seluser env | grep ANYTHING
# sudo w -E option (to preserve the current environment variables in the child bash): ANYTHING is propagated
root@f29746d3ae3d:/# sudo -E -u seluser env | grep ANYTHING
ANYTHING=123
# sudo w -E -i option (to preserve the current environment variables in the child bash but also run .bashrc (needed to start a browser)): ANYTHING is not propagated
root@f29746d3ae3d:/# sudo -E -i -u seluser env | grep ANYTHINGThe The only way I found to make it work is here in my commit HIH |
|
Thanks for the explanation. 2 things.
|
d35b3ba to
272da09
Compare
Signed-off-by: Mathieu POUSSE <m.mathieu.pousse@gmail.com>
272da09 to
e36109e
Compare
|
here we are, yes i've signed the CLA thx |
manullay transmit env variables to selenium user in *debug*
|
Well done! Could you tell me if the CI does push the new docker images on the docker hub every time there is a commit on the master? This is to know when I could rely on official images instead of using the one from our fork. Thanks in advance for the response and for what you do with OSS ! M. |
the debug images are using the
sudo -E -i -u seluserto start the selenium stuffs and browser with the appropriated seluser.Unfortunatly, as described in the sudoers documentation:
That means the env variables from the docker client won't be transmitted to the browser with
-iAs the
-iis mandatory to initiate the browser stuffs and-Eis useless, I have added a trick to extract env variables from the root users and pass them to the seluser.This is definitly needed to make the debug images working