forked from kube-reporting/metering-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.metering-ansible-operator
58 lines (48 loc) · 2.69 KB
/
Dockerfile.metering-ansible-operator
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
52
53
54
55
56
57
58
# need the helm-cli from the helm image
FROM quay.io/openshift/origin-metering-helm:latest as helm
# final image needs kubectl, so we copy `oc` from cli image to use as kubectl.
FROM openshift/origin-cli:latest as cli
# the base image is the ansible-operator's origin images
# TODO: stop using the latest tag for base images
FROM quay.io/openshift/origin-ansible-operator:4.5
USER root
RUN set -x; INSTALL_PKGS="curl bash ca-certificates less which inotify-tools openssl" \
&& yum clean all && rm -rf /var/cache/yum/* \
&& yum -y install epel-release \
&& yum install --setopt=skip_missing_names_on_install=False -y \
$INSTALL_PKGS \
&& yum clean all \
&& rm -rf /var/cache/yum
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
COPY --from=helm /usr/local/bin/helm /usr/local/bin/helm
COPY --from=cli /usr/bin/oc /usr/bin/oc
RUN ln -f -s /usr/bin/oc /usr/bin/kubectl
# put tini into our path
RUN ln -f -s /tini /usr/bin/tini
# List of python packages:
# 1. botocore and boto3 are used by the aws-related modules (aws_s3)
# 2. netaddr is needed to use the ipv4/ipv6 jinja filter
# 3. cryptography is used by the openssl_* modules for TLS/authentication purposes
# TODO: the ansible-operator base image uses setuptools >= 45.2.0 which needs python 3.5 so this is a temporary fix
RUN pip install --no-cache-dir --upgrade openshift botocore boto3 cryptography netaddr "setuptools<=45.1.0"
# In order to use the 'ansible_failed_result' and 'ansible_failed_task' variables in a block/rescue,
# we need to ensure that the 2.8 version is being used while this is fixed in 2.9 upstream.
# TODO: revert this change once the issue mentioned above is resolved.
RUN pip install --upgrade ansible==2.8
ENV HOME /opt/ansible
ENV HELM_CHART_PATH ${HOME}/charts/openshift-metering
COPY images/metering-ansible-operator/roles/ ${HOME}/roles/
COPY images/metering-ansible-operator/watches.yaml ${HOME}/watches.yaml
COPY images/metering-ansible-operator/scripts ${HOME}/scripts
COPY images/metering-ansible-operator/ansible.cfg /etc/ansible/ansible.cfg
COPY charts/openshift-metering ${HELM_CHART_PATH}
COPY manifests/deploy/openshift/olm/bundle /manifests
USER 1001
ENTRYPOINT ["tini", "--", "/usr/local/bin/ansible-operator", "exec-entrypoint", "ansible", "--watches-file", "/opt/ansible/watches.yaml"]
LABEL io.k8s.display-name="OpenShift metering-ansible-operator" \
io.k8s.description="This is a component of OpenShift Container Platform and manages installation and configuration of all other metering components." \
io.openshift.tags="openshift" \
com.redhat.delivery.appregistry=true \
maintainer="[email protected]"