aboutsummaryrefslogtreecommitdiff
path: root/docker/kolla-toolbox/Dockerfile.j2
blob: 20e692f77dae55519578180737c0d478be4468df (plain)
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
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
MAINTAINER {{ maintainer }}

{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}

RUN yum -y install \
        gcc \
        git \
        libffi-devel \
        libxml2-devel \
        libxslt-devel \
        mariadb-devel \
        openssl-devel \
        python-devel \
        openssh-clients \
    && yum clean all \
    && rpm -e --nodeps pytz

{% elif base_distro in ['ubuntu', 'debian'] %}

RUN apt-get -y --no-install-recommends install \
        build-essential \
        ca-certificates \
        git \
        libffi-dev \
        libmariadbclient-dev \
        libssl-dev \
        libxslt1-dev \
        python-dev \
    && apt-get clean

{% endif %}

RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
    && python get-pip.py \
    && rm get-pip.py \
    && pip --no-cache-dir install \
        MySQL-python \
        os-client-config==1.16.0 \
        pyudev \
        shade==1.4.0

RUN git clone https://github.com/ansible/ansible.git \
    && cd ansible \
    && git checkout 89569d035ea5002302a0a6b03451a4963fd83eb3 \
    && git submodule update --init --recursive \
    && pip --no-cache-dir install .

RUN mkdir -p /etc/ansible /usr/share/ansible /home/ansible \
    && echo 'localhost ansible_connection=local' > /etc/ansible/hosts \
    && useradd --user-group ansible --groups kolla \
    && sed -i 's|  "identity_api_version": "2.0",|  "identity_api_version": "3",|' /usr/lib/python2.7/site-packages/os_client_config/defaults.json

COPY find_disks.py kolla_keystone_service.py kolla_keystone_user.py kolla_sanity.py kolla_zookeeper.py /usr/share/ansible/
COPY ansible.cfg /home/ansible/.ansible.cfg

CMD ["/bin/sleep", "infinity"]

{{ include_footer }}

USER ansible