-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile-canary
66 lines (51 loc) · 2.18 KB
/
Dockerfile-canary
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
59
60
61
62
63
64
65
66
FROM centos:7
MAINTAINER Ansible Playbook Bundle Community
LABEL "com.redhat.apb.runtime"="2"
ENV USER_NAME=apb \
USER_UID=1001 \
BASE_DIR=/opt/apb
ENV HOME=${BASE_DIR}
RUN mkdir -p /usr/share/ansible/openshift \
/etc/ansible /opt/apb/env /opt/ansible
RUN yum -y install epel-release centos-release-openshift-origin \
&& yum -y update \
&& yum -y install bind-utils \
gcc \
git \
libffi-devel \
make \
net-tools \
openssl-devel \
origin \
origin-clients \
python-cffi \
python-devel \
python-pip \
python-setuptools \
python2-jmespath \
&& yum clean all
#Workaround for installing python-daemon (pulled in by ansible-runner)
RUN pip install docutils
#Pin Jinja2 to work around https://github.com/ansible/ansible/issues/40185
RUN pip install Jinja2==2.7.2
RUN pip install \
https://github.com/ansible/ansible/archive/devel.tar.gz \
https://github.com/ansible/ansible-runner/archive/master.tar.gz
RUN git clone https://github.com/openshift/openshift-restclient-python
RUN cd openshift-restclient-python \
&& pip install -U urllib3==1.22 \
&& pip install -r requirements.txt \
&& python setup.py install
RUN git clone https://github.com/ansible/ansible-kubernetes-modules.git /etc/ansible/roles/ansible.kubernetes-modules
RUN git clone https://github.com/ansibleplaybookbundle/ansible-asb-modules.git /etc/ansible/roles/ansibleplaybookbundle.asb-modules
COPY files/usr/bin/* /usr/bin/
COPY files/opt/apb/. /opt/apb/
RUN mkdir -p /usr/share/ansible/openshift \
/etc/ansible /opt/ansible \
${BASE_DIR}/{etc,.kube,.ansible/tmp} \
&& useradd -u ${USER_UID} -r -g 0 -M -d ${BASE_DIR} -b ${BASE_DIR} -s /sbin/nologin -c "apb user" ${USER_NAME} \
&& chown -R ${USER_NAME}:0 /opt/{ansible,apb} \
&& chmod -R g=u /opt/{ansible,apb} /etc/passwd
RUN mkdir /etc/apb-secrets
WORKDIR /opt/apb
ENTRYPOINT ["entrypoint.sh"]