Jenkins, Docker agents, and /etc/environment

12 views
Skip to first unread message

Zach LaCelle

unread,
Nov 13, 2018, 3:36:32 PM11/13/18
to Jenkins Users
I have some proxy settings defined in the /etc/environment files of my Docker images which constitute my Jenkins agents. These images are correctly spun up and Jenkins happily builds within them, with one issue: the variables from /etc/environment aren't present in the agent environment.

When I run "docker run -it myimage /bin/bash" I can see the variables set correctly.

When I run "env" within a Jenkins build, they are not.

I understand that Jenkins launches non-interactive shells, but these should still read /etc/environment, I believe.

What is the best way to get Jenkins agents to respect environment variables from the system? Is there a better option than /etc/environment?
Reply all
Reply to author
Forward
0 new messages