anchor.diff:  ENV JAVA_HOME /usr/java/latest
   
   # install jenkins
  -ARG user=jenkins
  -ARG group=jenkins
  -ARG uid=1000
  -ARG gid=1000
  -ARG http_port=8080
  -ARG agent_port=50000
  +ARG user=jenkins \
  +    group=jenkins \
  +    uid=1000 \
  +    gid=1000 \
  +    http_port=8080 \
  +    agent_port=50000 \
  +    JENKINS_VERSION
   
  -ENV JENKINS_ADMIN_USERNAME admin
  -ENV JENKINS_ADMIN_PASSWORD admin
  -ENV JENKINS_HOME /var/jenkins_home
  -ENV JENKINS_SLAVE_AGENT_PORT ${agent_port}
  +ENV HOME=/var/jenkins_home \
  +    JENKINS_HOME=/var/jenkins_home \
  +    JENKINS_ADMIN_USERNAME=admin \
  +    JENKINS_ADMIN_PASSWORD=admin \
  +    JENKINS_SLAVE_AGENT_PORT=${agent_port} \
  +    JENKINS_VERSION=${JENKINS_VERSION:-2.60.2}
   
   # Jenkins is run with user `jenkins`, uid = 1000
   # If you bind mount a volume from the host or a data container,
  
positive.code: # install java 8
  RUN yum install -y git wget zip unzip
  
  ENV JAVA_VERSION 8u144
  ENV BUILD_VERSION b01
  
  RUN wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/$JAVA_VERSION-$BUILD_VERSION/090f390dda5b47b9b721c7dfaa008135/jdk-$JAVA_VERSION-linux-x64.rpm" -O /tmp/jdk-8-linux-x64.rpm
  
  RUN yum -y install /tmp/jdk-8-linux-x64.rpm
  
  RUN alternatives --install /usr/bin/java java /usr/java/latest/bin/java 20000 && \
      alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000 && \
      alternatives --install /usr/bin/javaws javaws /usr/java/latest/bin/javaws 20000 && \
      alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 20000
  
negative.code: 
  COPY ./scripts/jenkins.sh /usr/local/bin/jenkins.sh
  
  RUN chmod +x /usr/local/bin/install-plugins.sh /usr/local/bin/jenkins.sh && \
      /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt && \
      chown -R ${user} $JENKINS_HOME /usr/share/jenkins/ref /usr/local/bin
  
  USER ${user}
  ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"]
  