-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (27 loc) · 1.47 KB
/
Dockerfile
File metadata and controls
31 lines (27 loc) · 1.47 KB
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
# The automation collection requires ansible 2.10+, RH documentation sees 2.10 as an interim release and not recommended
# so using v2.11 (currently in preview) to satisfy ansible version requirement of the automation. Collection has been tested and
# works with this version.
FROM quay.io/operator-framework/ansible-operator-2.11-preview:v1.16
COPY requirements.yml ${HOME}/requirements.yml
RUN ansible-galaxy collection install -r ${HOME}/requirements.yml \
&& chmod -R ug+rwx ${HOME}/.ansible
COPY watches.yaml ${HOME}/watches.yaml
COPY roles/ ${HOME}/roles/
COPY playbooks/ ${HOME}/playbooks/
COPY tasks/ ${HOME}/tasks/
COPY templates/ ${HOME}/templates/
#Add dependent CLIs - need to add as root since it's in /usr/local/bin
#After install switch back to user 1001 so we aren't running as root
USER root
RUN curl -sLo /tmp/oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.8.7/openshift-client-linux-4.8.7.tar.gz && \
tar xzvf /tmp/oc.tar.gz -C /usr/local/bin/ && rm /tmp/oc.tar.gz
RUN curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
RUN pip3 install jq
RUN pip3 install yq
USER 1001
CMD ["/usr/local/bin/oc"]
#Create the default masconfig directory to store config information needed for mas, mongo, sls
#this will be the directory used in those roles. These subdirectories get automatically created
#at runtime based on the instance id name and not recommended to change.
RUN bash -c 'mkdir -p ~/masconfig/inst1'
RUN bash -c 'chmod 775 ~/masconfig/inst1'