1
- FROM maven:latest as builder
1
+ FROM debian:stable-slim as fetcher
2
2
3
+ # TODO copy just the 'distribution' directory, not all source code
3
4
COPY ./ /opengrok-source
4
5
WORKDIR /opengrok-source
5
6
6
- RUN apt-get update && apt-get install -y python3 python3-venv
7
- RUN mvn -f pom.xml clean package -DskipTests=true
7
+ # update the system
8
+ RUN apt-get update
9
+
8
10
# find most recent package file
9
11
RUN cp `ls -t distribution/target/*.tar.gz | head -n1 |awk '{printf("%s",$0)}' ` /opengrok.tar.gz
10
12
11
13
FROM tomcat:9-jre8
12
14
LABEL maintainer
"[email protected] "
13
15
14
16
# prepare OpenGrok binaries and directories
15
- COPY --from=builder opengrok.tar.gz /opengrok.tar.gz
17
+ COPY --from=fetcher opengrok.tar.gz /opengrok.tar.gz
16
18
RUN mkdir -p /opengrok /var/opengrok/etc /opengrok/data /opengrok/src && \
17
19
tar -zxvf /opengrok.tar.gz -C /opengrok --strip-components 1 && \
18
20
rm -f /opengrok.tar.gz
19
21
20
- # install dependencies
21
- RUN apt-get update && apt-get install -y git subversion mercurial unzip inotify-tools python3 python3-pip && \
22
+ # install dependencies and Python tools
23
+ RUN apt-get update && apt-get install -y git subversion mercurial unzip inotify-tools python3 python3-pip python3-venv && \
22
24
python3 -m pip install /opengrok/tools/opengrok-tools*
25
+
23
26
# compile and install universal-ctags
24
27
RUN apt-get install -y pkg-config autoconf build-essential && git clone https://github.com/universal-ctags/ctags /root/ctags && \
25
28
cd /root/ctags && ./autogen.sh && ./configure && make && make install && \
@@ -39,7 +42,6 @@ ENV CATALINA_TMPDIR /usr/local/tomcat/temp
39
42
ENV JRE_HOME /usr
40
43
ENV CLASSPATH /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
41
44
42
-
43
45
# custom deployment to / with redirect from /source
44
46
RUN rm -rf /usr/local/tomcat/webapps/* && \
45
47
opengrok-deploy /opengrok/lib/source.war /usr/local/tomcat/webapps/ROOT.war && \
0 commit comments