Skip to content

Commit a1b86b3

Browse files
committed
initial changes for rhel9
1 parent 9b86b2b commit a1b86b3

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Build stage 1
2+
3+
FROM openshift/golang-builder:rhel_9_golang_1.16 AS builder
4+
5+
COPY $REMOTE_SOURCE $REMOTE_SOURCE_DIR
6+
7+
WORKDIR $REMOTE_SOURCE_DIR/app
8+
9+
RUN dnf install -y glibc-static
10+
11+
RUN go build -o $REMOTE_SOURCE_DIR/app/bin/snmp_notifier -ldflags "-s -X github.com/prometheus/common/version.Version=1.2.1 -X github.com/prometheus/common/version.Revision=14ba67401c61cfc2f19ebd9ace8acdcf47b4cd49 -X github.com/prometheus/common/version.Branch=master -X github.com/prometheus/common/version.BuildUser=osbs -X github.com/prometheus/common/version.BuildDate=20211104-18:55:37 -extldflags '-static'" -a -tags netgo ${REMOTE_SOURCE_DIR}/app/snmp_notifier.go
12+
13+
# Build stage 2
14+
15+
FROM registry.redhat.io/ubi8/ubi-minimal
16+
17+
# Update the image to get the latest CVE updates
18+
RUN microdnf update -y && \
19+
microdnf clean all
20+
21+
ENV OPBIN=/usr/local/bin/snmp_notifier
22+
23+
COPY --from=builder $REMOTE_SOURCE_DIR/app/bin/snmp_notifier "$OPBIN"
24+
COPY --from=builder $REMOTE_SOURCE_DIR/app/description-template.tpl /etc/snmp_notifier/description-template.tpl
25+
26+
LABEL maintainer="Guillaume Abrioux <[email protected]>"
27+
LABEL com.redhat.component="snmp-notifier-container"
28+
LABEL name="snmp-notifier"
29+
LABEL version="1.2.1"
30+
LABEL description="SNMP Notifier container"
31+
LABEL summary="Provides snmp_notifier container."
32+
LABEL io.k8s.display-name="SNMP Notifier container"
33+
LABEL io.k8s.description="SNMP Notifier container receives alerts from the Prometheus' Alertmanager and routes them as SNMP traps."
34+
35+
RUN chmod +x "$OPBIN"
36+
37+
EXPOSE 9464
38+
ENTRYPOINT ["/usr/local/bin/snmp_notifier"]
39+
CMD ["--snmp.trap-description-template=/etc/snmp_notifier/description-template.tpl"]
40+

container.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
compose:
3+
pulp_repos: true
4+
image_build_method: imagebuilder
5+
remote_source:
6+
repo: https://github.com/maxwo/snmp_notifier.git
7+
ref: 73773b728ff6147d9590e6db86e44a668bbd93d5
8+
pkg_managers:
9+
- gomod
10+
flags:
11+
- gomod-vendor

content_sets.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This is a file defining which content sets (yum repositories) are needed to
2+
# update content in this image. Data provided here helps determine which images
3+
# are vulnerable to specific CVEs. Generally you should only need to update this
4+
# file when:
5+
# 1. You start depending on a new product
6+
# 2. You are preparing new product release and your content sets will change
7+
#
8+
# See https://mojo.redhat.com/docs/DOC-1023066 for more information on
9+
# maintaining this file and the format and examples
10+
#
11+
# You should have one top level item for each architecture being built. Most
12+
# likely this will be x86_64 and ppc64le initially.
13+
---
14+
x86_64:
15+
- rhel-9-for-x86_64-baseos-rpms
16+
- rhel-9-for-x86_64-appstream-rpms
17+
- codeready-builder-for-rhel-9-x86_64-rpms
18+
ppc64le:
19+
- rhel-9-for-ppc64le-baseos-rpms
20+
- rhel-9-for-ppc64le-appstream-rpms
21+
- codeready-builder-for-rhel-9-ppc64le-rpms
22+
s390x:
23+
- rhel-9-for-s390x-baseos-rpms
24+
- rhel-9-for-s390x-appstream-rpms
25+
- codeready-builder-for-rhel-9-s390x-rpms

sources

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SHA512 (snmp_notifier-1.2.1.tar.gz) = 21cd3efca0defeab0ccd5505a6d51200e5aa60f1f998058127f28789d2535513c77b05708766b839546a038887fd3fd807f128afe1751b0dc858875471bb0667

0 commit comments

Comments
 (0)