-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
54 lines (46 loc) · 1.46 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
FROM alpine:3.9
RUN apk add --no-cache \
bash \
gettext \
monit \
su-exec \
supervisor
ARG UNISON_VERSION=2.51.2
ENV UNISON_VERSION=$UNISON_VERSION
RUN apk add --no-cache build-base curl ocaml \
&& curl -L https://github.com/bcpierce00/unison/archive/v$UNISON_VERSION.tar.gz | tar zxv -C /tmp \
&& cd /tmp/unison-${UNISON_VERSION} \
&& sed -i -e 's/GLIBC_SUPPORT_INOTIFY 0/GLIBC_SUPPORT_INOTIFY 1/' src/fsmonitor/linux/inotify_stubs.c \
&& make UISTYLE=text NATIVE=true STATIC=true \
&& apk del build-base curl ocaml \
&& cp src/unison src/unison-fsmonitor /usr/local/bin \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/unison-${UNISON_VERSION}
ARG UNISON_DATA=/unison_data
ARG HOST_DATA_PATH=/host
ARG CONTAINER_DATA_PATH=/container
ENV \
UNISONLOCALHOSTNAME=syncer \
UNISON_DATA=/unison_data \
UNISON_DEFAULT_OPTS="-batch -auto" \
UNISON_OPTS="" \
CONTAINER_DATA_PATH=$CONTAINER_DATA_PATH \
HOST_DATA_PATH=$HOST_DATA_PATH \
SYNC_UID=0 \
SYNC_USER=syncer \
MONIT_CHECK_INTERVAL=1 \
MONIT_ENABLED=true \
MONIT_HIGH_CPU_THRESHOLD=60 \
MONIT_HIGH_CPU_CYCLES=5
RUN mkdir -p \
/docker-entrypoint.d \
/etc/supervisor.conf.d \
$UNISON_DATA \
$CONTAINER_DATA_PATH \
$HOST_DATA_PATH
COPY docker-entrypoint.sh /
COPY monitrc.template supervisord.conf /etc/
VOLUME $UNISON_DATA
VOLUME $CONTAINER_DATA_PATH
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["run"]