# Based on centos this image builds cinderlib master with Cinder master branch
FROM centos:7
ARG VERSION
ARG RELEASE
LABEL maintainers="Gorka Eguileor <geguileo@redhat.com>" \
      description="Cinderlib" \
      version=${VERSION:-latest}

RUN yum -y install targetcli iscsi-initiator-utils device-mapper-multipath epel-release lvm2 which && \
    yum -y install python2-pip centos-release-openstack-${RELEASE} pywbem && \
    yum -y install openstack-cinder python-rbd ceph-common python2-pyOpenSSL && \
    pip install --no-cache-dir 'krest>=1.3.0' 'purestorage>=1.6.0' 'pyxcli>=1.1.5' && \
    yum clean all && \
    rm -rf /var/cache/yum

# Copy cinderlib
COPY . /cinderlib

RUN pip install --no-cache-dir /cinderlib/ && \
    rm -rf /cinderlib

# Define default command
CMD ["bash"]
