-
Notifications
You must be signed in to change notification settings - Fork 70
/
Dockerfile-canary
29 lines (22 loc) · 1.04 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
FROM centos:7
RUN yum -y install epel-release centos-release-openshift-origin \
&& yum -y install python-virtualenv git sudo origin-clients wget \
&& yum clean all
RUN virtualenv --no-setuptools /opt/apb
RUN source /opt/apb/bin/activate && wget https://bootstrap.pypa.io/get-pip.py
RUN source /opt/apb/bin/activate && python get-pip.py
RUN git clone https://github.com/ansibleplaybookbundle/ansible-playbook-bundle
RUN source /opt/apb/bin/activate \
&& cd ansible-playbook-bundle \
&& pip install -r src/requirements.txt \
&& python setup.py install
RUN echo -ne "#!/bin/bash\nsource /opt/apb/bin/activate\napb \$@" > /usr/local/bin/apb-wrapper
RUN chmod +x /usr/local/bin/apb-wrapper
RUN echo "ALL ALL=NOPASSWD: ALL" > /etc/sudoers.d/usermod
RUN chmod 666 /etc/passwd
COPY apb-wrapper /usr/local/bin/apb-wrapper
RUN chmod +x /usr/local/bin/apb-wrapper
WORKDIR /mnt
ENTRYPOINT ["apb-wrapper"]
CMD ["-h"]
LABEL RUN docker run --privileged --rm -v \${PWD}:/mnt -v \$HOME/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u \${SUDO_UID} \${IMAGE}