Guest User

Untitled

a guest
May 24th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. FROM ubuntu:14.04
  2. # Install Java.
  3. RUN
  4. echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections &&
  5. apt-get update &&
  6. apt-get upgrade -y &&
  7. apt-get install -y software-properties-common &&
  8. add-apt-repository ppa:webupd8team/java -y &&
  9. apt-get update &&
  10. apt-get install -y oracle-java8-installer &&
  11. rm -rf /var/lib/apt/lists/* &&
  12. rm -rf /var/cache/oracle-jdk8-installer
  13.  
  14. # Define commonly used JAVA_HOME variable
  15. ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
  16.  
  17. # get maven 3.2.2 and verify its checksum
  18. RUN wget --no-verbose -O /tmp/apache-maven-3.2.2.tar.gz http://archive.apache.org/dist/maven/maven-3/3.2.2/binaries/apache-maven-3.2.2-bin.tar.gz;
  19. echo "87e5cc81bc4ab9b83986b3e77e6b3095 /tmp/apache-maven-3.2.2.tar.gz" | md5sum -c
  20. ARG BASE_URL=https://apache.osuosl.org/maven/ven-3/${MAVEN_VERSION}/binaries
  21.  
  22. # install maven
  23. RUN tar xzf /tmp/apache-maven-3.2.2.tar.gz -C /opt/;
  24. ln -s /opt/apache-maven-3.2.2 /opt/maven;
  25. ln -s /opt/maven/bin/mvn /usr/local/bin;
  26. rm -f /tmp/apache-maven-3.2.2.tar.gz
  27. ENV MAVEN_HOME /opt/maven
  28.  
  29.  
  30. # Install dependencies
  31. RUN apt-get -y update &&
  32. apt-get -yqq --no-install-recommends install bash git bzip2 curl unzip &&
  33. apt-get update
  34.  
  35. # copy jenkins war file to the container
  36. #ADD http://mirrors.jenkins.io/war-stable/2.107.1/jenkins.war /opt/jenkins.war
  37. COPY jenkins.war /opt/jenkins.war
  38. ENV JENKINS_HOME /jenkins
  39.  
  40. # configure the container to run jenkins, mapping container port 8080 to that host port
  41. RUN mkdir /jenkins/
  42. COPY proxy.xml /jenkins/proxy.xml
  43. COPY config_updated.xml opt/config_updated.xml
  44.  
  45. COPY settings.xml /usr/share/maven/conf/settings.xml
  46. ENTRYPOINT ["java","-jar","/opt/jenkins.war"]
  47. ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false"
  48.  
  49. #Install plugins
  50. RUN cd /usr/local/bin && curl -L https://raw.githubusercontent.com/hgomez/devops-incubator/master/forge-tricks/batch-install-jenkins-plugins.sh -o batch-install-jenkins-plugins.sh
  51. RUN chmod +x /usr/local/bin/batch-install-jenkins-plugins.sh
  52. COPY /plugins.txt /usr/share/jenkins/ref/plugins.txt
  53. RUN xargs /usr/local/bin/batch-install-jenkins-plugins.sh < /usr/share/jenkins/ref/plugins.txt
  54. RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state
Add Comment
Please, Sign In to add comment