-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5987045
commit 16e947f
Showing
6 changed files
with
385 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,51 @@ | ||
FROM registry.redhat.io/rhel7 | ||
# This is an intermediate image | ||
FROM registry.redhat.io/rhel8/python-38 as base | ||
|
||
COPY version/VERSION /exporter/ | ||
COPY exporter.py /exporter/ | ||
COPY metrics.json /exporter/ | ||
|
||
# Using Red Hat Universal Base Image 8 | ||
# This is final shipping image | ||
FROM registry.redhat.io/ubi8 | ||
|
||
ARG VER | ||
### Required Atomic/OpenShift Labels - https://github.com/projectatomic/ContainerApplicationGenericLabels | ||
LABEL name="Citrix ADC Metric Exporter" \ | ||
maintainer="NSCPXOrchestration@citrite.net" \ | ||
vendor="Citrix" \ | ||
version=${VER} \ | ||
summary="Citrix provides an metrics exporter for Citrix ADC MPX (hardware), Citrix ADC VPX (virtualized), Citrix ADC CPX (containerized) and Citrix ADC BLX (Bare Metal) for on-prem and cloud deployments. It is is a simple server that scrapes Citrix ADC stats and exports them via HTTP to Prometheus." \ | ||
description="Citrix provides an metrics exporter for Citrix ADC MPX (hardware), Citrix ADC VPX (virtualized), Citrix ADC CPX (containerized) and Citrix ADC BLX (Bare Metal) for on-prem and cloud deployments. It is is a simple server that scrapes Citrix ADC stats and exports them via HTTP to Prometheus." | ||
|
||
#### add licenses to this directory | ||
COPY license/LICENSE /licenses/ | ||
|
||
# Make bash the default shell | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# RHEL 8 requires a subscription. Use --build-arg USERNAME=<RHEL_USERNAME> --build-arg PASSWORD=<RHEL_PASSWORD> for these arguments. | ||
ARG USERNAME | ||
ARG PASSWORD | ||
RUN subscription-manager register --username ${USERNAME} --password ${PASSWORD} --auto-attach | ||
RUN subscription-manager repos --enable rhel-7-server-optional-rpms --enable rhel-7-server-extras-rpms --enable rhel-server-rhscl-7-rpms | ||
|
||
RUN yum -y update \ | ||
&& yum -y install python27-python-pip \ | ||
&& yum clean all \ | ||
&& scl enable python27 bash | ||
ENV PATH /opt/rh/python27/root/usr/bin:$PATH | ||
ENV LD_LIBRARY_PATH /opt/rh/python27/root/usr/lib64 | ||
RUN pip install prometheus_client requests pyyaml | ||
COPY version/VERSION /exporter/ | ||
COPY exporter.py /exporter/ | ||
COPY metrics.json /exporter/ | ||
&& yum -y install python38 \ | ||
&& alternatives --set python /usr/bin/python3 \ | ||
&& dnf install -y python3-pip \ | ||
&& yum clean all | ||
|
||
# Removing subscription from image as private RHEL credential was used for the subscription. | ||
RUN subscription-manager unregister | ||
COPY --from=base /opt/app-root/lib/python3.8/site-packages/ /usr/lib/python3.8/site-packages/ | ||
COPY --from=base /usr/lib64/libpython* /usr/local/lib/ | ||
COPY --from=base /exporter /exporter/ | ||
RUN touch /exporter/exporter.log | ||
RUN ln -sf /dev/stdout /exporter/exporter.log | ||
USER nobody | ||
COPY ./pip_requirements.txt . | ||
RUN python3.8 -m pip install -r pip_requirements.txt | ||
|
||
# Starting CIC as nobody | ||
USER nobody | ||
|
||
ENTRYPOINT ["python", "/exporter/exporter.py" ] | ||
ENTRYPOINT ["python3.8", "/exporter/exporter.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.