-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.centos
41 lines (31 loc) · 1.81 KB
/
Dockerfile.centos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM centos:latest
MAINTAINER ranjithum
ARG opengrok_version="1.3.4"
ARG tomcat_version="9.0.24"
RUN dnf update -y && \
dnf install -y openssh-server python3 python3-pip git wget cronie java-11-openjdk-devel && \
dnf groupinstall "Development Tools" -y
RUN wget -q https://archive.apache.org/dist/tomcat/tomcat-9/v${tomcat_version}/bin/apache-tomcat-${tomcat_version}.tar.gz && \
tar -xf apache-tomcat-${tomcat_version}.tar.gz -C /usr/share/ && \
ln -s /usr/share/apache-tomcat-$tomcat_version/ /usr/share/tomcat && \
groupadd --system tomcat && useradd -d /usr/share/tomcat -r -s /bin/false -g tomcat tomcat && \
chown -R tomcat:tomcat /usr/share/tomcat /usr/share/apache-tomcat-$tomcat_version/
RUN wget -q https://github.com/oracle/opengrok/releases/download/${opengrok_version}/opengrok-${opengrok_version}.tar.gz && \
tar -xf opengrok-${opengrok_version}.tar.gz
RUN python3 -m pip install /opengrok-${opengrok_version}/tools/opengrok-tools.tar.gz
RUN git clone https://github.com/universal-ctags/ctags && \
cd ctags && ./autogen.sh && ./configure && make -j4 && make install
COPY open-grok_syncer.sh /var/opengrok/etc/
COPY indexer_cron /etc/cron.d/indexer_cron
COPY start_service_centos.sh start_service_centos.sh
ADD start_tomcat.sh /usr/share/tomcat/bin/start_tomcat.sh
RUN mkdir -p /var/opengrok/data /var/opengrok/etc /var/opengrok/source /root/.ssh && \
touch /root/.ssh/config /home/id_rsa && \
chmod 400 /home/id_rsa && \
chmod 0644 /etc/cron.d/indexer_cron && \
crontab /etc/cron.d/indexer_cron && \
cp /opengrok-${opengrok_version}/lib/source.war /usr/share/tomcat/webapps/suckit.war && \
rm -rf /ctags /opengrok-${opengrok_version}.tar.gz /apache-tomcat-${tomcat_version}.tar.gz
RUN yum group remove Development Tools -y && \
yum clean all
CMD ./start_service_centos.sh