-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (31 loc) · 1.61 KB
/
Dockerfile
File metadata and controls
42 lines (31 loc) · 1.61 KB
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
FROM telegraf:1.37-alpine
ENV ZOOKEEPER_MONITORING_HOME=/opt/zookeeper-monitoring
RUN echo "https://dl-cdn.alpinelinux.org/alpine/v3.23/main" > /etc/apk/repositories && \
echo "https://dl-cdn.alpinelinux.org/alpine/v3.23/community" >> /etc/apk/repositories
RUN mkdir -p ${ZOOKEEPER_MONITORING_HOME}
COPY docker/config/requirements.txt ${ZOOKEEPER_MONITORING_HOME}/requirements.txt
COPY exec-scripts/ ${ZOOKEEPER_MONITORING_HOME}/exec-scripts/
COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
# Install misc. tools
RUN set -x \
&& apk add --upgrade --no-cache bash curl tini python3 apk-tools openssl
RUN rm /usr/lib/python3.12/EXTERNALLY-MANAGED
RUN python3 -m ensurepip \
&& rm -r /usr/lib/python*/ensurepip \
&& pip3 install --upgrade pip setuptools==80.9.0 \
&& pip3 install -r ${ZOOKEEPER_MONITORING_HOME}/requirements.txt \
&& chmod -R 777 ${ZOOKEEPER_MONITORING_HOME}/exec-scripts \
&& chmod +x /docker-entrypoint.sh \
&& python3 -m unittest discover -s ${ZOOKEEPER_MONITORING_HOME}/exec-scripts -p "test_*.py" \
&& rm -fr ${ZOOKEEPER_MONITORING_HOME}/exec-scripts/test_*.py \
&& rm -rf /var/cache/apk/*
# Upgrade all tools to avoid vulnerabilities
RUN set -x && apk upgrade --available
# Upgrade tools from edge to avoid vulnerabilities
RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/main" > /etc/apk/repositories \
&& echo "https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& apk add --update --no-cache --upgrade \
pcre2 curl gnutls libcurl jq
USER 1000:0
WORKDIR ${ZOOKEEPER_MONITORING_HOME}
ENTRYPOINT ["/docker-entrypoint.sh"]