-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
96 lines (73 loc) · 3.36 KB
/
Dockerfile
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# ------------------------------------------------------------------------------
# ## Stage 1 ##
FROM ubuntu:bionic AS builder
RUN apt-get update && apt-get dist-upgrade --assume-yes
RUN apt-get install --no-install-recommends --assume-yes \
autoconf \
automake \
build-essential \
ca-certificates \
curl \
diffutils \
git \
golang-go \
libtool \
openssl \
pkg-config
WORKDIR /tmp
## ctags ##
RUN git clone https://github.com/universal-ctags/ctags.git
RUN cd ctags && ./autogen.sh && ./configure && make
## Hound ##
ENV GOPATH=/go
# Install /go/bin/houndd, https://github.com/hound-search/hound#using-go-tools
RUN go get github.com/hound-search/hound/cmds/...
## jsonnet ##
# XXX: we do have the alternative sjsonnet.jar
RUN git clone https://github.com/google/jsonnet.git
RUN make -C jsonnet
# ------------------------------------------------------------------------------
# ## Stage 2 ##
FROM ubuntu:bionic AS app
## Bootstrap ##
RUN apt-get update && apt-get dist-upgrade --assume-yes
# https://docs.docker.com/engine/admin/multi-service_container/
RUN apt-get install --no-install-recommends --assume-yes \
cron \
curl \
diffutils \
git \
jq \
make \
libtcnative-1 \
nginx \
procps \
python3 \
python3-pip \
python3-setuptools \
supervisor \
tomcat9 \
vim
RUN apt-get autoremove
ENV BIN_DIR=/opt/bin
ENV PATH=${BIN_DIR}:${PATH}
RUN mkdir -p ${BIN_DIR}
COPY --from=builder /tmp/ctags/ctags ${BIN_DIR}
COPY --from=builder /go/bin/houndd ${BIN_DIR}
COPY --from=builder /tmp/jsonnet/jsonnet ${BIN_DIR}
RUN curl -L https://github.com/databricks/sjsonnet/releases/download/0.1.6/sjsonnet.jar \
-o ${BIN_DIR}/sjsonnet.jar
RUN chmod +x ${BIN_DIR}/sjsonnet.jar
## OpenGrok ##
ARG OPENGROK_RELEASE
RUN curl -L https://github.com/OpenGrok/OpenGrok/releases/download/${OPENGROK_RELEASE}/opengrok-${OPENGROK_RELEASE}.tar.gz \
-o /tmp/opengrok-${OPENGROK_RELEASE}.tar.gz
RUN mkdir -p /opengrok && tar zxvf /tmp/opengrok-${OPENGROK_RELEASE}.tar.gz --strip-components=1 -C /opengrok
# https://github.com/oracle/opengrok/tree/master/opengrok-tools#installation-on-the-target-system
RUN pip3 install /opengrok/tools/opengrok-tools.tar.gz
##
ADD scripts /scripts
WORKDIR /tmp
## Nginx ##
EXPOSE 8129
CMD ["make", "-C", "/scripts", "start-services"]