File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
snmp-exporter-config-generator Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM ubuntu:jammy AS build
2
+
3
+ RUN apt-get update -qq && \
4
+ apt-get install -y --no-install-recommends build-essential golang libsnmp-dev p7zip-full unzip git curl ca-certificates snmp-mibs-downloader
5
+
6
+ WORKDIR /build
7
+ RUN git init && \
8
+ git remote add origin https://github.com/prometheus/snmp_exporter && \
9
+ git fetch origin 58b902ede4f6bee7a150566ac7fae05ef0a4b1fb && \
10
+ git checkout FETCH_HEAD
11
+
12
+ WORKDIR /build/generator
13
+
14
+ RUN make mibs
15
+ RUN make generator
16
+ RUN download-mibs
17
+
18
+ FROM ubuntu:jammy
19
+
20
+ RUN apt-get update -qq && \
21
+ apt-get install -y --no-install-recommends libsnmp40 && \
22
+ rm -rf /var/lib/apt/lists/*
23
+
24
+ COPY --from=build /build/generator/generator /opt/snmp-exporter/bin/
25
+ COPY --from=build /build/generator/mibs/ /usr/share/snmp/mibs/
26
+ COPY --from=build /usr/share/snmp/mibs/ /usr/share/snmp/mibs/
27
+ COPY --from=build /var/lib/mibs/ /var/lib/mibs/
28
+
29
+ COPY ./entrypoint.sh /
30
+ RUN chmod +x /entrypoint.sh
31
+
32
+ ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -eu
3
+
4
+ cd " $( mktemp -d) "
5
+
6
+ cat > generator.yml
7
+ /opt/snmp-exporter/bin/generator generate
8
+ cat snmp.yml
You can’t perform that action at this time.
0 commit comments