|
1 | 1 | FROM centos:7
|
2 | 2 |
|
3 |
| -ADD https://github.com/krallin/tini/releases/download/v0.14.0/tini /tini |
| 3 | +ADD https://github.com/krallin/tini/releases/download/v0.18.0/tini /bin/tini |
| 4 | +ADD utils/entrypoint.sh /bin/entrypoint |
| 5 | +ADD demo/project /runner/project |
| 6 | +ADD demo/env /runner/env |
| 7 | +ADD demo/inventory /runner/inventory |
4 | 8 |
|
5 | 9 | # Install Ansible Runner
|
6 |
| -RUN yum -y install epel-release && \ |
7 |
| - yum -y install ansible python-psutil python-pip python-docutils bubblewrap bzip2 python-crypto openssh openssh-clients git && \ |
8 |
| - localedef -c -i en_US -f UTF-8 en_US.UTF-8 && \ |
9 |
| - chmod +x /tini && \ |
10 |
| - pip install --no-cache-dir wheel pexpect psutil python-daemon && \ |
11 |
| - rm -rf /var/cache/yum |
| 10 | +RUN yum-config-manager --add-repo https://releases.ansible.com/ansible-runner/ansible-runner.el7.repo && \ |
| 11 | + yum install -y epel-release && yum install -y python-pip ansible-runner bubblewrap sudo rsync && \ |
| 12 | + pip install --no-cache-dir ansible && \ |
| 13 | + localedef -c -i en_US -f UTF-8 en_US.UTF-8 && \ |
| 14 | + chmod +x /bin/tini /bin/entrypoint && rm -rf /var/cache/yum |
12 | 15 |
|
13 |
| -ENV LANG=en_US.UTF-8 \ |
14 |
| - LANGUAGE=en_US:en \ |
15 |
| - LC_ALL=en_US.UTF-8 |
| 16 | +# In OpenShift, container will run as a random uid number and gid 0. Make sure things |
| 17 | +# are writeable by the root group. |
| 18 | +RUN mkdir -p /runner/inventory /runner/project /runner/artifacts /runner/.ansible/tmp && \ |
| 19 | + chmod -R g+w /runner && chgrp -R root /runner && \ |
| 20 | + chmod g+w /etc/passwd |
16 | 21 |
|
17 | 22 | VOLUME /runner/inventory
|
18 | 23 | VOLUME /runner/project
|
19 | 24 | VOLUME /runner/artifacts
|
20 |
| -ENTRYPOINT ["/tini", "--"] |
21 |
| -WORKDIR / |
| 25 | + |
| 26 | +ENV LANG=en_US.UTF-8 |
| 27 | +ENV LANGUAGE=en_US:en |
| 28 | +ENV LC_ALL=en_US.UTF-8 |
22 | 29 | ENV RUNNER_BASE_COMMAND=ansible-playbook
|
23 |
| -CMD /entrypoint.sh |
| 30 | +ENV HOME=/runner |
24 | 31 |
|
25 |
| -ADD utils/entrypoint.sh /entrypoint.sh |
26 |
| -ADD demo/project /runner/project |
27 |
| -ADD demo/env /runner/env |
28 |
| -ADD demo/inventory /runner/inventory |
29 |
| -ADD dist/ansible_runner-1.3.4-py2.py3-none-any.whl /ansible_runner-1.3.4-py2.py3-none-any.whl |
30 |
| -# In OpenShift, container will run as a random uid number and gid 0. Make sure things |
31 |
| -# are writeable by the root group. |
32 |
| -RUN chmod 755 /entrypoint.sh && chmod -R g+w /runner && chgrp -R root /runner && \ |
33 |
| - chmod g+w /etc/passwd && \ |
34 |
| - pip install --no-cache-dir /ansible_runner-1.3.4-py2.py3-none-any.whl |
| 32 | +WORKDIR /runner |
| 33 | + |
| 34 | +ENTRYPOINT ["entrypoint"] |
| 35 | +CMD ["ansible-runner", "run", "/runner"] |
0 commit comments