collection.dockerfile/centos8/jenkins/Dockerfile

29 lines
1.4 KiB
Docker
Raw Normal View History

2022-01-17 15:56:05 +08:00
FROM centos:8
LABEL description="Jenkins on Tomcat, with git and ansible"
LABEL maintainer="racken@racker.tech"
LABEL notes="Get initial admin password by docker exec -it <container-id> and cat /root/.jenkins/secrets/initialAdminPassword"
LABEL java-version="java-11-openjdk"
LABEL exposed-port="8080"
LABEL jenkins-path="/jenkins"
ENV container docker
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 python3-pip yum-utils unzip; mkdir -p /opt/tomcat
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
RUN unzip -qq awscliv2.zip
RUN /aws/install
#RUN pip3 install ansible
WORKDIR /opt/tomcat
RUN wget -q -O- https://apache.website-solution.net/tomcat/tomcat-9/v9.0.43/bin/apache-tomcat-9.0.43.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
RUN yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
RUN yum -y install docker-ce-cli
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENV JAVA_HOME="/usr"
ENV JAVA_OPTS="-Djava.awt.headless=true -Xmx2g -Dhudson.DNSMultiCast.disabled=true -Duser.timezone=Asia/Hong_Kong"
EXPOSE 8080
ENTRYPOINT ["/tini", "--"]
CMD ["/opt/tomcat/bin/catalina.sh", "run"]