3
3
4
4
FROM ubuntu:bionic as build
5
5
6
- RUN apt-get update && apt-get install -y maven python3 python3-venv
6
+ # hadolint ignore=DL3008
7
+ RUN apt-get update && apt-get install --no-install-recommends -y maven python3 python3-venv && \
8
+ apt-get clean && \
9
+ rm -rf /var/lib/apt/lists/*
7
10
8
11
# Create a first layer to cache the "Maven World" in the local repository.
9
12
# Incremental docker builds will always resume after that, unless you update the pom
@@ -15,12 +18,12 @@ COPY plugins/pom.xml /mvn/plugins/
15
18
COPY suggester/pom.xml /mvn/suggester/
16
19
17
20
# distribution and tools do not have dependencies to cache
18
- RUN sed -i 's:<module>distribution</module>::g' /mvn/pom.xml
19
- RUN sed -i 's:<module>tools</module>::g' /mvn/pom.xml
20
-
21
- RUN mkdir -p /mvn/opengrok-indexer/target/jflex-sources
22
- RUN mkdir -p /mvn/opengrok-web/src/main/webapp/js
23
- RUN mkdir -p /mvn/opengrok-web/src/main/webapp/WEB-INF/ && touch /mvn/opengrok-web/src/main/webapp/WEB-INF/web.xml
21
+ RUN sed -i 's:<module>distribution</module>::g' /mvn/pom.xml && \
22
+ sed -i 's:<module>tools</module>::g' /mvn/pom.xml && \
23
+ mkdir -p /mvn/opengrok-indexer/target/jflex-sources && \
24
+ mkdir -p /mvn/opengrok-web/src/main/webapp/js && \
25
+ mkdir -p /mvn/opengrok-web/src/main/webapp/WEB-INF/ && \
26
+ touch /mvn/opengrok-web/src/main/webapp/WEB-INF/web.xml
24
27
25
28
# dummy build to cache the dependencies
26
29
RUN mvn -DskipTests -Dcheckstyle.skip -Dmaven.antrun.skip package
@@ -30,33 +33,38 @@ COPY ./ /opengrok-source
30
33
WORKDIR /opengrok-source
31
34
32
35
RUN mvn -DskipTests=true -Dmaven.javadoc.skip=true -B -V package
36
+ # hadolint ignore=SC2012,DL4006
33
37
RUN cp `ls -t distribution/target/*.tar.gz | head -1` /opengrok.tar.gz
34
38
35
39
FROM tomcat:10-jdk11
36
40
LABEL maintainer="https://github.com/oracle/opengrok"
37
41
38
42
# install dependencies and Python tools
43
+ # hadolint ignore=DL3008,DL3009
39
44
RUN apt-get update && \
40
- apt-get install -y git subversion mercurial unzip inotify-tools python3 python3-pip python3-venv
45
+ apt-get install --no-install-recommends -y git subversion mercurial unzip inotify-tools python3 python3-pip \
46
+ python3-venv python3-setuptools
41
47
42
48
# compile and install universal-ctags
43
- RUN apt-get install -y pkg-config autoconf build-essential && \
49
+ # hadolint ignore=DL3003,DL3008
50
+ RUN apt-get install --no-install-recommends -y pkg-config automake build-essential && \
44
51
git clone https://github.com/universal-ctags/ctags /root/ctags && \
45
52
cd /root/ctags && ./autogen.sh && ./configure && make && make install && \
46
- apt-get remove -y autoconf build-essential && \
53
+ apt-get remove -y automake build-essential && \
47
54
apt-get -y autoremove && apt-get -y autoclean && \
48
- cd /root && rm -rf /root/ctags
55
+ cd /root && rm -rf /root/ctags && \
56
+ apt-get clean && \
57
+ rm -rf /var/lib/apt/lists/*
49
58
50
59
# prepare OpenGrok binaries and directories
60
+ # hadolint ignore=DL3010
51
61
COPY --from=build opengrok.tar.gz /opengrok.tar.gz
62
+ # hadolint ignore=DL3013
52
63
RUN mkdir -p /opengrok /opengrok/etc /opengrok/data /opengrok/src && \
53
64
tar -zxvf /opengrok.tar.gz -C /opengrok --strip-components 1 && \
54
- rm -f /opengrok.tar.gz
55
-
56
- RUN python3 -m pip install /opengrok/tools/opengrok-tools*
57
-
58
- # for /reindex REST endpoint handled by start.py
59
- RUN python3 -m pip install Flask Flask-HTTPAuth waitress
65
+ rm -f /opengrok.tar.gz && \
66
+ python3 -m pip install --no-cache-dir /opengrok/tools/opengrok-tools* && \
67
+ python3 -m pip install --no-cache-dir Flask Flask-HTTPAuth waitress # for /reindex REST endpoint handled by start.py
60
68
61
69
# environment variables
62
70
ENV SRC_ROOT /opengrok/src
@@ -69,11 +77,11 @@ ENV PATH $CATALINA_HOME/bin:$PATH
69
77
ENV CLASSPATH /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
70
78
71
79
# disable all file logging
72
- ADD docker/logging.properties /usr/local/tomcat/conf/logging.properties
80
+ COPY docker/logging.properties /usr/local/tomcat/conf/logging.properties
73
81
RUN sed -i -e 's/Valve/Disabled/' /usr/local/tomcat/conf/server.xml
74
82
75
83
# add our scripts
76
- ADD docker /scripts
84
+ COPY docker /scripts
77
85
RUN chmod -R +x /scripts
78
86
79
87
# run
0 commit comments