title: Changing the user's uid in a pre-build docker container (jenkins)
body: <p>I am new to docker, so if this is a fairly obvious process that I am missing, I do apologize for the dumb question up front.</p>
  
  <p>I am setting up a continuous integration server using the <code>jenkins</code> docker image.  I did a <code>docker pull jenkins</code>, and created a user <code>jenkins</code> to allow me to mount the <code>/var/jenkins_home</code> in the container to my host's <code>/var/jenkins_home</code> (also owned by <code>jenkins:jenkins</code> user).</p>
  
  <p>the problem is that the container seems to define the <code>jenkins</code> user with uid 102, but my host has the <code>jenkins</code> user as 1002, so when I run it I get:</p>
  
  <pre><code>docker run --name jenkins -u jenkins -p 8080 -v /var/jenkins_home:/var/jenkins_home jenkins
  /usr/local/bin/jenkins.sh: line 25: /var/jenkins_home/copy_reference_file.log: Permission denied
  </code></pre>
  
  <p>I would simply make the uid for the host's <code>jenkins</code> user be 102 in <code>/etc/passwd</code>, but that uid is already taken by sshd.  I think the solution is to change the container to use uid 1002 instead, but I am not sure how.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Actually, user 102 on the host is messagebus, not sshd.</p>