Skip to content

Commit 6e6addf

Browse files
mcanoyoybed
authored andcommitted
use ubi instead of centos (#157)
* use ubi instead of centos * change base image registry * avoid httpd php install
1 parent 40df5a5 commit 6e6addf

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

images/openshift-applier/Dockerfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1-
FROM centos:centos7
1+
FROM registry.access.redhat.com/ubi8/ubi
2+
3+
ENV pip_packages "ansible"
24

35
ENV OC_CLIENT_MIRROR https://mirror.openshift.com/pub/openshift-v3/clients/3.11.115/linux/oc.tar.gz
4-
ENV ANSIBLE_RPM https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.8.0-1.el7.ans.noarch.rpm
5-
ENV INSTALL_PKGS "git"
6+
ENV INSTALL_PKGS "git python3"
67
ENV WORK_DIR /openshift-applier
78
ENV HOME ${WORK_DIR}
89
ENV USER_UID 1001
910

1011
USER root
1112

12-
# Install Ansible and the 'oc' client
13-
RUN yum install -y $INSTALL_PKGS ;\
14-
yum install -y $ANSIBLE_RPM ;\
13+
RUN yum -y install --disableplugin=subscription-manager $INSTALL_PKGS ;\
1514
curl $OC_CLIENT_MIRROR | tar -C /usr/local/bin/ -xzf - ;\
16-
yum clean all ;\
15+
yum --disableplugin=subscription-manager clean all ;\
1716
rm -rf /var/cache/yum
1817

18+
# Install Ansible via Pip.
19+
RUN pip3 install ansible
20+
21+
RUN mkdir -p /etc/ansible
22+
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
23+
1924
COPY . ${WORK_DIR}
2025
COPY images/openshift-applier/root /
2126
RUN /usr/local/bin/user_setup_casl
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/bash
2-
DEFAULT_INV=$HOME/test/inventory
2+
DEFAULT_INV=/etc/ansible
33
DEFAULT_PLAYBOOK=$HOME/playbooks/openshift-cluster-seed.yml
44

5-
cmd="/usr/bin/ansible-playbook -i ${INVENTORY_PATH:-$DEFAULT_INV} ${PLAYBOOK:-$DEFAULT_PLAYBOOK}"
5+
cmd="/usr/local/bin/ansible-playbook -i ${INVENTORY_PATH:-$DEFAULT_INV} ${PLAYBOOK:-$DEFAULT_PLAYBOOK}"
6+
echo "command: $cmd"
67

78
exec ${cmd}

0 commit comments

Comments
 (0)