forked from emirica/twamp-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (22 loc) · 807 Bytes
/
Dockerfile
File metadata and controls
36 lines (22 loc) · 807 Bytes
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
FROM alpine:3.7 as build_step
LABEL author="Ryan Shaw <[email protected]>"
RUN apk --no-cache add git make gcc libc-dev
ADD . /twamp-protocol
WORKDIR /twamp-protocol
RUN make
RUN chmod +x server
FROM alpine:3.7
RUN apk --no-cache add libcap tini
RUN addgroup -S twamp && adduser -S -G twamp twamp
COPY --from=build_step --chown=twamp:twamp /twamp-protocol/server /usr/local/bin/
COPY health_check.sh /
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/server
EXPOSE 862
STOPSIGNAL SIGINT
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/sbin/tini", "--"]
USER twamp
HEALTHCHECK --interval=5s --timeout=5s --start-period=1s --retries=3 CMD [ "/health_check.sh" ]
CMD [ "/usr/local/bin/server" ]