-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
32 lines (24 loc) · 1.06 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
FROM python:3.7-slim
ARG EXPORTER_USER_HOME="/usr/local/exporter"
ENV EXPORTER_HOME="${EXPORTER_USER_HOME}"
COPY . /prometheus-ss-exporter
RUN set -ex \
&& apt-get update \
&& apt-get install -y git curl \
&& apt-get clean \
&& pip install --no-cache-dir -U pip \
&& cd /prometheus-ss-exporter \
&& python3 setup.py install
# interim -- install ss2 from forked pyroute2
RUN /bin/bash -c "git clone https://github.com/cherusk/pyroute2.git \
&& pushd pyroute2 \
&& git checkout origin/ss2_patch_class_level_data \
&& cp pyroute2/netlink/diag/ss2.py /usr/local/lib/python3.7/site-packages/pyroute2-0.7.8-py3.7.egg/pyroute2/netlink/diag/ss2.py \
&& popd \
&& rmdir --ignore-fail-on-non-empty pyroute2"
EXPOSE 8090
HEALTHCHECK --interval=1s --timeout=2s --retries=1 \
CMD curl -f http://localhost:"${PORT}"/health || exit 1
USER root
WORKDIR "${EXPORTER_HOME}"
ENTRYPOINT prometheus_ss_exporter --port "${PORT}" --cnfg "${CONFIG_FILE}"