-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathDockerfile_rhel
51 lines (41 loc) · 2.21 KB
/
Dockerfile_rhel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# 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="[email protected]" \
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 yum -y update \
&& 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
COPY ./pip_requirements.txt .
RUN python3.8 -m pip install -r pip_requirements.txt
# Starting CIC as nobody
USER nobody
ENTRYPOINT ["python3.8", "/exporter/exporter.py"]