title: When building Jenkins in Docker plugins fail to install
body: <p>I have a Dockerfile for a custom Jenkins master like so:</p>
  
  <pre><code>FROM jenkins
  MAINTAINER me
  
  USER root
  
  RUN echo 2.0 &gt; /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state
  
  RUN apt-get update \
        &amp;&amp; apt-get install -y sudo \
        &amp;&amp; apt-get install -y vim \
        &amp;&amp; rm -rf /var/lib/apt/lists/*
  RUN echo "jenkins ALL=NOPASSWD: ALL" &gt;&gt; /etc/sudoers
  
  USER jenkins
  
  # COPY plugins.txt /usr/share/jenkins/plugins.txt
  # RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt
  ENV JAVA_OPTS="-Xmx8192m"
  ENV JENKINS_OPTS="--handlerCountStartup=100 --handlerCountMax=300"
  
  
  RUN /usr/local/bin/install-plugins.sh git:2.6.0
  </code></pre>
  
  <p>Everything works fine until the <code>RUN /usr/local/bin/install-plugins.sh git:2.6.0</code> line. I get an error installing the plugins:</p>
  
  <pre><code>Creating initial locks...
  
  Analyzing war...
  
  Downloading plugins...
  Downloading plugin: git from https://updates.jenkins.io/download/plugins/git/2.6.0/git.hpi
  Downloading plugin: git-plugin from https://updates.jenkins.io/download/plugins/git-plugin/2.6.0/git-plugin.hpi
  Failed to download plugin: git or git-plugin
  
  WAR bundled plugins:
  
  
  Installed plugins:
  *:
  
  Some plugins failed to download!
  Not downloaded: git
  The command '/bin/sh -c /usr/local/bin/install-plugins.sh git:2.6.0' returned a non-zero code: 1
  </code></pre>
  
  <p>Am I doing something wrong or is this an issue with Jenkins/Docker?</p>