summaryrefslogtreecommitdiffstats
path: root/compass-tasks-base/misc/Dockerfile
blob: ed47aea7988a76b5a34235f1055467b81ae6b26a (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
from centos:latest

# repos
COPY misc/compass_install.repo /etc/yum.repos.d/compass_install.repo

RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
    sed -i 's/^mirrorlist=https/mirrorlist=http/g' /etc/yum.repos.d/epel.repo && \
    yum update -y

# packages
RUN yum --enablerepo=compass_install --nogpgcheck install -y python python-devel git amqp python-pip libffi-devel openssl-devel gcc python-setuptools MySQL-python supervisor redis sshpass python-keyczar vim ansible-2.2.1.0

# code
RUN mkdir -p /root/compass-tasks
COPY . /root/compass-tasks
RUN mkdir -p /root/compass-tasks/compass && \
    touch /root/compass-tasks/compass/__init__.py
RUN mv /root/compass-tasks/actions /root/compass-tasks/compass/ && \
    mv /root/compass-tasks/apiclient /root/compass-tasks/compass/ && \
    mv /root/compass-tasks/tasks /root/compass-tasks/compass/ && \
    mv /root/compass-tasks/utils /root/compass-tasks/compass/ && \
    mv /root/compass-tasks/deployment /root/compass-tasks/compass/ && \
    mv /root/compass-tasks/db /root/compass-tasks/compass/ && \
    mv /root/compass-tasks/hdsdiscovery /root/compass-tasks/compass/ && \
    mv /root/compass-tasks/log_analyzor /root/compass-tasks/compass/

# pip
RUN easy_install --upgrade pip && \
    pip install --upgrade pip && \
    pip install --upgrade setuptools && \
    pip install --upgrade Flask

# conf
RUN mkdir -p /etc/compass/ && \
    mkdir -p /etc/compass/machine_list && \
    mkdir -p /etc/compass/switch_list && \
    #cp -rf /root/compass-tasks/conf/* /etc/compass/ && \
    cd /root/compass-tasks && \
    python setup.py install

RUN mkdir -p /root/.ssh; \
    echo "UserKnownHostsFile /dev/null" >> /root/.ssh/config; \
    echo "StrictHostKeyChecking no" >> /root/.ssh/config

COPY supervisord.conf /etc/supervisord.conf
COPY start.sh /usr/local/bin/start.sh
RUN mkdir -p /var/log/compass
RUN mkdir -p /opt/ansible_callbacks
#RUN git clone https://github.com/openstack-ansible/openstack-ansible-modules /opt/openstack-ansible-modules
EXPOSE 6379
VOLUME ["/var/ansible", "/etc/compass/machine_list", "/etc/compass/switch_list"]
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["/usr/local/bin/start.sh"]