title: How can I create a Jenkins Docker image that uses provided ssh keys for jenkins user?
body: <p>While I create an image based on official Jenkins Docker and copy <code>.ssh</code> directory to <code>jenkins</code> user's home (<code>/var/jenkins_home</code>), owner of the <code>/var/jenkins_home/.ssh</code> becomes <code>root</code> which prevents me to open ssh session with <code>jenkins</code> user. Using <code>RUN chown -R 1000:1000 /var/jenkins_home/.ssh</code> in <code>Dockerfile</code> does not work. </p>
  
  <p>Also, permissions of the files copied while creating image becomes <code>644</code> by default. However, to be able to open ssh session, permissions of <code>/var/jenkins_home/.ssh/id_rsa</code> must be <code>600</code>. </p>
  
  <p>How can I create an image from official Jenkins Docker image having provided ssh keys for <code>jenkins</code> user?</p>