Dockerfile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ######################
  2. ## Dockerfile to build container images consisting of Node.js and nginx environment
  3. # Based on Ubuntu
  4. #####
  5. # Set the base image to Ubuntu
  6. FROM ubuntu
  7. # File Author / Maintainer
  8. # MAINTAINER name Chunteng Xiao
  9. RUN apt-get clean
  10. RUN apt-get update
  11. RUN apt-get install -y software-properties-common
  12. RUN add-apt-repository ppa:webupd8team/java
  13. RUN apt-get update
  14. RUN apt-get -f install -y curl unzip wget tar
  15. RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
  16. RUN apt-get install -y oracle-java8-installer
  17. RUN apt-get install -y oracle-java8-set-default
  18. ADD ./sonar-scanner-cli-3.2.0.1227-linux.zip ./sonarscanner.zip
  19. RUN unzip sonarscanner.zip
  20. RUN rm sonarscanner.zip
  21. ENV SONAR_RUNNER_HOME=/sonar-scanner-3.2.0.1227-linux
  22. ENV PATH $PATH:/sonar-scanner-3.2.0.1227-linux/bin
  23. RUN wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-9/v9.0.12/bin/apache-tomcat-9.0.12.tar.gz
  24. RUN tar xzf apache-tomcat-9.0.12.tar.gz
  25. RUN mv apache-tomcat-9.0.12 apache-tomcat9
  26. RUN wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz
  27. RUN tar xzvf apache-maven-3.5.4-bin.tar.gz
  28. RUN ln -s apache-maven-3.5.4 apache-maven
  29. ENV M2_HOME=//apache-maven
  30. ENV CATALINA_HOME=/apache-tomcat9
  31. ENV TOMCAT_HOME=/apache-tomcat9
  32. ENV MAVEN_HOME=/apache-maven
  33. ENV PATH=${M2_HOME}/bin:${PATH}
  34. ENV JAVA_HOME=/usr/lib/jvm/java-8-oracle
  35. ENV JRE_HOME=/usr/lib/jvm/java-8-oracle/jre
  36. ADD ca.crt ./
  37. COPY ./additional_jars ./additional_jars
  38. COPY tomcat-users.xml ${CATALINA_HOME}/conf/tomcat-users.xml
  39. COPY context.xml ${CATALINA_HOME}/webapps/manager/META-INF/context.xml
  40. RUN keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -noprompt -alias maven2.ca -file ca.crt
  41. RUN keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/jssecacerts -storepass changeit -noprompt -alias maven2.ca -file ca.crt
  42. RUN mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.2.0.1.0 -Dpackaging=jar -Dfile=./additional_jars/ojdbc7.jar
  43. COPY sonar-runner.properties ./sonar-scanner-3.2.0.1227-linux/conf/sonar-scanner.properties
  44. EXPOSE 84
  45. EXPOSE 8080