title: Jenkins Pipeline inside docker container with SSH file transfer using SSH Key
body: <p>I am trying to migrate a teamcity pipeline to a jenkins one.</p>
  
  <p>I am used to teamcity, and I still finding my way around Jenkins, but I haven't found a way to do this.</p>
  
  <p>I want to have a pipeline with 2 steps, one for compiling an application, and a second step to send it to a server using SSH with private keys.</p>
  
  <p>I can easily do that in Teamcity (after some research) but with Jenkins I have researched it and haven't found a way to get there, nor examples over the web.</p>
  
  <p>I have tried a freestyle project where I can configure SSH agent but I can't seem to find where to place the rest of the logic, and a multibranch pipeline which uses a Jenkinsfile within the repo to compile, but nowhere to set details for sending files over.</p>
  
  <p>Should I use a multibranch pipeline and "send" the files from within the jenkinsfile? If so, how do I tell Jenkins to make the key available to the docker container?</p>
  
  <p>Or should I use the freestyle project, and if so, how do I tell it to use the Jenkinsfile first, and then send the resulting file or files to the destination server?</p>
  
  <p>Or should I use something completely different?</p>