|
1 |
| -FROM ubuntu:jammy AS build |
| 1 | +FROM public.ecr.aws/ubuntu/ubuntu:jammy AS build |
2 | 2 |
|
3 | 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 |
| 4 | + apt-get install -y --no-install-recommends build-essential golang libsnmp-dev p7zip-full unzip git curl ca-certificates snmp-mibs-downloader rename |
5 | 5 |
|
6 | 6 | WORKDIR /build
|
7 | 7 | RUN git init && \
|
8 | 8 | git remote add origin https://github.com/prometheus/snmp_exporter && \
|
9 |
| - git fetch origin 58b902ede4f6bee7a150566ac7fae05ef0a4b1fb && \ |
| 9 | + git fetch --depth=1 origin 4b68fe9f8155d81bdaf3e2ef018532da545aa969 && \ |
10 | 10 | git checkout FETCH_HEAD
|
11 | 11 |
|
12 | 12 | WORKDIR /build/generator
|
13 | 13 |
|
14 | 14 | RUN make mibs
|
15 |
| -RUN mv mibs/cisco_v2/* mibs/ |
16 | 15 | RUN make generator
|
17 | 16 | RUN download-mibs
|
18 | 17 |
|
19 |
| -FROM ubuntu:jammy |
| 18 | +WORKDIR /build/generator/cisco |
| 19 | +RUN git init && \ |
| 20 | + git remote add origin https://github.com/cisco/cisco-mibs && \ |
| 21 | + git fetch --depth=1 origin 2d465cce2de4e67a3561d8e41e4c99b597558d4b && \ |
| 22 | + git checkout FETCH_HEAD |
| 23 | + |
| 24 | +RUN file-rename -- 's/\.my$//' v2/*.my |
| 25 | + |
| 26 | +FROM public.ecr.aws/ubuntu/ubuntu:jammy |
20 | 27 |
|
21 | 28 | RUN apt-get update -qq && \
|
22 | 29 | apt-get install -y --no-install-recommends libsnmp40 && \
|
23 | 30 | rm -rf /var/lib/apt/lists/*
|
24 | 31 |
|
25 | 32 | COPY --from=build /build/generator/generator /opt/snmp-exporter/bin/
|
26 | 33 | COPY --from=build /build/generator/mibs/ /usr/share/snmp/mibs/
|
| 34 | +COPY --from=build /build/generator/cisco/v2/ /usr/share/snmp/mibs/ |
27 | 35 | COPY --from=build /usr/share/snmp/mibs/ /usr/share/snmp/mibs/
|
28 | 36 | COPY --from=build /var/lib/mibs/ /var/lib/mibs/
|
29 | 37 |
|
30 |
| -COPY ./entrypoint.sh / |
| 38 | +COPY --chmod=0755 ./entrypoint.sh / |
31 | 39 | RUN chmod +x /entrypoint.sh
|
32 | 40 |
|
33 | 41 | ENTRYPOINT ["/entrypoint.sh"]
|
0 commit comments