<p>Can you pass a binary from a Jenkins host to an agent?</p>
<p>I've got Jenkins running in Kubernetes, and the terraform plugin installed on my Jenkins master with the binary located at <code>/var/jenkins_home/tools/org.jenkinsci.plugins.terraform.TerraformInstallation/terraform/terraform</code></p>
<p>I would like to pass this to my Jenkins agent by configuring my pod template and mounting the host volume path <code>/var/jenkins_home/tools/org.jenkinsci.plugins.terraform.TerraformInstallation/terraform/terraform</code> to the agent's path <code>/usr/bin/terraform</code></p>
<p>But this doesn't seem to work as expected</p>
<p>When I exec into the agent and run a <code>terraform version</code> I get the error <code>bash: terraform: command not found</code> indicating that it doesn't have the binary.</p>
<p>I can see a terraform directory mounted in <code>/usr/bin</code> but without the binary. What I expect is for terraform to be installed on the agent. But my thinking might be incorrect here.</p>
<p>Is it possible to do this, has anyone has any experience with this?</p>

<p>As a @David Maze mentioned binary from <a href="https://www.jenkins.io/" rel="nofollow noreferrer">Jenkins</a> needs to be manually installed on every node, which can be a difficult to manage. However you can set Jenkins to run pipeline steps inside a container where the image contains the tools you need, which simplifies such case.</p>
<p>Read more: <a href="https://www.jenkins.io/doc/book/pipeline/docker/#execution-environment" rel="nofollow noreferrer">execution-env-jenkins</a>.</p>
