-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile
47 lines (37 loc) · 1.1 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
FROM debian:9 as mirror-builder
# Install dependencies
RUN apt-get update -q && apt-get install -qy \
libssl-dev \
autoconf \
automake \
libtool \
python-setuptools python-dev \
curl \
build-essential \
pkg-config \
openjdk-8-jdk-headless \
git
# Install 'watchman'
RUN cd /tmp && \
curl -sL 'https://github.com/facebook/watchman/archive/v4.9.0.tar.gz' | tar xzf - && \
cd watchman-* && \
./autogen.sh && \
./configure && \
make && \
make install
# Build 'mirror'
COPY . /tmp/mirror
WORKDIR /tmp/mirror
RUN ./gradlew shadowJar
# ------------------------------------------------------------------- #
FROM debian:9
RUN apt-get update -q && apt-get install -qy \
openjdk-8-jre-headless
COPY --from=mirror-builder /usr/local/bin/watchman /usr/local/bin/
RUN install -d -m 777 /usr/local/var/run/watchman
WORKDIR "/opt/mirror"
COPY --from=mirror-builder /tmp/mirror/mirror ./
COPY --from=mirror-builder /tmp/mirror/build/libs/mirror-all.jar ./
RUN chmod a+s /usr/sbin/useradd /usr/sbin/groupadd
ADD docker/docker-entrypoint.sh docker-entrypoint.sh
ENTRYPOINT ["./docker-entrypoint.sh"]