11# Build stage 1
2-
3- # FROM openshift/golang-builder:rhel_9_golang_1.23 AS builder
4- FROM quay.io/projectquay/golang:1.24 AS builder
2+ FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.24 AS builder
53
64COPY snmp_notifier snmp_notifier
75
86WORKDIR snmp_notifier
97
10- RUN dnf install -y glibc-static
8+ RUN dnf install -y glibc glibc-devel glibc -static
119
1210# Build the binary
1311RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -mod=readonly \
@@ -22,16 +20,16 @@ RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -mod=readonly \
2220 -a -tags netgo
2321
2422# Build stage 2
25- FROM registry.redhat.io/ubi8/ubi -minimal
23+ FROM --platform=$BUILDPLATFORM registry.redhat.io/ubi8-minimal:latest
2624
2725# Update the image to get the latest CVE updates
2826RUN microdnf update -y && \
2927 microdnf clean all
3028
3129ENV OPBIN=/usr/local/bin/snmp_notifier
3230
33- COPY --from=builder /go/ snmp_notifier/snmp_notifier "$OPBIN"
34- COPY --from=builder /go/ snmp_notifier/description-template.tpl /etc/snmp_notifier/description-template.tpl
31+ COPY --from=builder /snmp_notifier/snmp_notifier "$OPBIN"
32+ COPY --from=builder /snmp_notifier/description-template.tpl /etc/snmp_notifier/description-template.tpl
3533
3634LABEL maintainer=
"Guillaume Abrioux <[email protected] >" 3735LABEL com.redhat.component="snmp-notifier-container"
@@ -41,10 +39,12 @@ LABEL description="SNMP Notifier container"
4139LABEL summary="Provides snmp_notifier container."
4240LABEL io.k8s.display-name="SNMP Notifier container"
4341LABEL io.k8s.description="SNMP Notifier container receives alerts from the Prometheus' Alertmanager and routes them as SNMP traps."
42+ LABEL io.openshift.tags="1.2.1"
43+ LABEL cpe=cpe:/a:redhat:ceph_storage:5::el8
44+ LABEL org.opencontainers.image.created="${BUILD_DATE}"
4445
4546RUN chmod +x "$OPBIN"
4647
4748EXPOSE 9464
4849ENTRYPOINT ["/usr/local/bin/snmp_notifier" ]
49- CMD ["--snmp.trap-description-template=/etc/snmp_notifier/description-template.tpl" ]
50-
50+ CMD ["--snmp.trap-description-template=/etc/snmp_notifier/description-template.tpl" ]
0 commit comments