-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (35 loc) · 1.43 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
FROM ubuntu:24.04
LABEL description="Zabbix Kubernetes Discovery" \
maintainer="DJΞRFY <[email protected]>" \
repository="https://github.com/djerfy/zabbix-kubernetes-discovery"
WORKDIR /app
ENV ZABBIX_ENDPOINT=""
ENV KUBERNETES_NAME=""
ARG CONTAINER_USER="zabbix"
ARG CONTAINER_GROUP="zabbix"
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
curl \
iputils-ping \
python3 \
python3-pip \
python3-venv && \
rm -rf /var/lib/apt/lists && \
mkdir -p /app /root/.kube && \
touch /app/crontab && \
groupadd -g 2000 ${CONTAINER_GROUP} && \
useradd -u 2000 -d /app -s /bin/bash -M -g ${CONTAINER_GROUP} ${CONTAINER_USER} && \
python3 -m venv venv
ARG SUPERCRONIC_VER="0.2.33"
ARG SUPERCRONIC_SHA="71b0d58cc53f6bd72cf2f293e09e294b79c666d8"
RUN curl -fsSLO "https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VER}/supercronic-linux-amd64" && \
echo "${SUPERCRONIC_SHA} supercronic-linux-amd64" | sha1sum -c - && \
chmod +x supercronic-linux-amd64 && \
mv supercronic-linux-amd64 /usr/local/bin/supercronic
COPY ./src/ /app/
RUN chown ${CONTAINER_USER}:${CONTAINER_GROUP} -R /app && \
chmod +x /app/*.py && \
/app/venv/bin/pip3 install --no-cache-dir -r /app/requirements.txt
USER ${CONTAINER_USER}:${CONTAINER_GROUP}
CMD ["/usr/local/bin/supercronic", "-split-logs", "-json", "/app/crontab"]