docker-odoo-image icon indicating copy to clipboard operation
docker-odoo-image copied to clipboard

[RFC] shippable-image: Export environment variables from "docker -e VARIABLE..." to ssh

Open moylop260 opened this issue 7 years ago • 2 comments

Currently we have ssh access for runbot builds but the environment variables is not detected

Using:

docker run --name=myctn -p 8022:22 -e VARIABLE=1 IMAGE bash
docker exec -it myctn bash
echo $VARIABLE
1  #  <<--- good

ssh -p 8022 odoo@localhost
echo $VARIABLE
  # <<-- nothing???

Many variables are used from MQT scripts could be a good feature have this environment variables.

NOTE: Except environment variables secrets like as TOKEN

moylop260 avatar Apr 19 '17 01:04 moylop260

@ruiztulio Do you have any idea about?

moylop260 avatar Apr 19 '17 02:04 moylop260

@moylop260 That's because ssh creates a non-interactive shell thus i won't load those vars, in bash is possible to override this adding the variables (if you want them to available for all users) in /etc/profile so they'll be available for all users in both modes (non and interactive) or in the user's ~/.bashrc

As they are not secrets, I guess that there is no problem adding those files

ruiztulio avatar Apr 20 '17 04:04 ruiztulio