2020-04-28 18:38:37 +08:00
FROM centos:8
2020-04-28 19:46:58 +08:00
LABEL description="Jenkins on Tomcat"
2020-04-28 18:38:37 +08:00
LABEL maintainer="racken@one27.cf"
LABEL notes="Get initial admin password by docker exec -it <container-id> and cat /root/.jenkins/secrets/initialAdminPassword"
2020-04-28 19:46:58 +08:00
LABEL java-version="java-11-openjdk"
2020-04-28 18:38:37 +08:00
LABEL jenkins-version="2.222.3"
LABEL exposed-port="8080"
LABEL jenkins-path="/jenkins"
ENV container docker
2020-04-28 19:46:58 +08:00
RUN yum -y install java-11-openjdk-headless wget dejavu-fonts-common dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts java-11-openjdk-devel git; mkdir -p /opt/tomcat
2020-04-28 18:38:37 +08:00
WORKDIR /opt/tomcat
RUN wget -q -O- http://ftp.cuhk.edu.hk/pub/packages/apache.org/tomcat/tomcat-9/v9.0.34/bin/apache-tomcat-9.0.34.tar.gz | tar zxf - --strip-components=1
RUN rm -rf /opt/tomcat/webapps/ROOT
RUN wget -q -O /opt/tomcat/webapps/jenkins.war http://mirrors.jenkins.io/war-stable/latest/jenkins.war
ENV JAVA_HOME="/usr"
ENV JAVA_OPTS="-Djava.awt.headless=true -Xmx2g -Dhudson.DNSMultiCast.disabled=true -Duser.timezone=Asia/Hong_Kong"
EXPOSE 8080
CMD ["/opt/tomcat/bin/catalina.sh", "run"]