From 87b8d2c1331d9bf5fbbb970c5e43b3d65db9c3cc Mon Sep 17 00:00:00 2001 From: Swapnil Kulkarni Date: Wed, 12 Aug 2015 10:38:06 +0000 Subject: [PATCH] Add Dockerfile template for Cinder Change-Id: I3791b58f15802f9ddbedb48d1a846813b05e0209 Partially-Implements: blueprint dockerfile-template --- .../cinder/cinder-api/Dockerfile.j2 | 16 ++++++++++ docker_templates/cinder/cinder-api/build | 1 + .../cinder/cinder-api/config-external.sh | 1 + docker_templates/cinder/cinder-api/start.sh | 1 + .../cinder/cinder-backup/Dockerfile.j2 | 7 ++++ docker_templates/cinder/cinder-backup/build | 1 + .../cinder/cinder-backup/config-external.sh | 1 + .../cinder/cinder-backup/start.sh | 1 + .../cinder/cinder-base/Dockerfile.j2 | 32 +++++++++++++++++++ docker_templates/cinder/cinder-base/build | 1 + .../cinder/cinder-data/Dockerfile.j2 | 9 ++++++ docker_templates/cinder/cinder-data/build | 1 + .../cinder/cinder-scheduler/Dockerfile.j2 | 7 ++++ .../cinder/cinder-scheduler/build | 1 + .../cinder-scheduler/config-external.sh | 1 + .../cinder/cinder-scheduler/start.sh | 1 + .../cinder/cinder-volume/Dockerfile.j2 | 17 ++++++++++ docker_templates/cinder/cinder-volume/build | 1 + .../cinder/cinder-volume/config-external.sh | 1 + .../cinder/cinder-volume/start.sh | 1 + 20 files changed, 102 insertions(+) create mode 100644 docker_templates/cinder/cinder-api/Dockerfile.j2 create mode 120000 docker_templates/cinder/cinder-api/build create mode 120000 docker_templates/cinder/cinder-api/config-external.sh create mode 120000 docker_templates/cinder/cinder-api/start.sh create mode 100644 docker_templates/cinder/cinder-backup/Dockerfile.j2 create mode 120000 docker_templates/cinder/cinder-backup/build create mode 120000 docker_templates/cinder/cinder-backup/config-external.sh create mode 120000 docker_templates/cinder/cinder-backup/start.sh create mode 100644 docker_templates/cinder/cinder-base/Dockerfile.j2 create mode 120000 docker_templates/cinder/cinder-base/build create mode 100644 docker_templates/cinder/cinder-data/Dockerfile.j2 create mode 120000 docker_templates/cinder/cinder-data/build create mode 100644 docker_templates/cinder/cinder-scheduler/Dockerfile.j2 create mode 120000 docker_templates/cinder/cinder-scheduler/build create mode 120000 docker_templates/cinder/cinder-scheduler/config-external.sh create mode 120000 docker_templates/cinder/cinder-scheduler/start.sh create mode 100644 docker_templates/cinder/cinder-volume/Dockerfile.j2 create mode 120000 docker_templates/cinder/cinder-volume/build create mode 120000 docker_templates/cinder/cinder-volume/config-external.sh create mode 120000 docker_templates/cinder/cinder-volume/start.sh diff --git a/docker_templates/cinder/cinder-api/Dockerfile.j2 b/docker_templates/cinder/cinder-api/Dockerfile.j2 new file mode 100644 index 0000000000..97ad23ac01 --- /dev/null +++ b/docker_templates/cinder/cinder-api/Dockerfile.j2 @@ -0,0 +1,16 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-cinder-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %} + +RUN yum install -y python-keystone \ + && yum clean all + + {% endif %} +{% endif %} + +COPY ./start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker_templates/cinder/cinder-api/build b/docker_templates/cinder/cinder-api/build new file mode 120000 index 0000000000..43944faa00 --- /dev/null +++ b/docker_templates/cinder/cinder-api/build @@ -0,0 +1 @@ +../../../tools/build-docker-image \ No newline at end of file diff --git a/docker_templates/cinder/cinder-api/config-external.sh b/docker_templates/cinder/cinder-api/config-external.sh new file mode 120000 index 0000000000..dc4bc440d7 --- /dev/null +++ b/docker_templates/cinder/cinder-api/config-external.sh @@ -0,0 +1 @@ +../../../docker/common/cinder/cinder-api/config-external.sh \ No newline at end of file diff --git a/docker_templates/cinder/cinder-api/start.sh b/docker_templates/cinder/cinder-api/start.sh new file mode 120000 index 0000000000..3cb4181785 --- /dev/null +++ b/docker_templates/cinder/cinder-api/start.sh @@ -0,0 +1 @@ +../../../docker/common/cinder/cinder-api/start.sh \ No newline at end of file diff --git a/docker_templates/cinder/cinder-backup/Dockerfile.j2 b/docker_templates/cinder/cinder-backup/Dockerfile.j2 new file mode 100644 index 0000000000..8ef8c045af --- /dev/null +++ b/docker_templates/cinder/cinder-backup/Dockerfile.j2 @@ -0,0 +1,7 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-cinder-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +COPY ./start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker_templates/cinder/cinder-backup/build b/docker_templates/cinder/cinder-backup/build new file mode 120000 index 0000000000..43944faa00 --- /dev/null +++ b/docker_templates/cinder/cinder-backup/build @@ -0,0 +1 @@ +../../../tools/build-docker-image \ No newline at end of file diff --git a/docker_templates/cinder/cinder-backup/config-external.sh b/docker_templates/cinder/cinder-backup/config-external.sh new file mode 120000 index 0000000000..ad560f28de --- /dev/null +++ b/docker_templates/cinder/cinder-backup/config-external.sh @@ -0,0 +1 @@ +../../../docker/common/cinder/cinder-backup/config-external.sh \ No newline at end of file diff --git a/docker_templates/cinder/cinder-backup/start.sh b/docker_templates/cinder/cinder-backup/start.sh new file mode 120000 index 0000000000..4402c4f218 --- /dev/null +++ b/docker_templates/cinder/cinder-backup/start.sh @@ -0,0 +1 @@ +../../../docker/common/cinder/cinder-backup/start.sh \ No newline at end of file diff --git a/docker_templates/cinder/cinder-base/Dockerfile.j2 b/docker_templates/cinder/cinder-base/Dockerfile.j2 new file mode 100644 index 0000000000..6f3238c788 --- /dev/null +++ b/docker_templates/cinder/cinder-base/Dockerfile.j2 @@ -0,0 +1,32 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %} + +RUN yum -y install openstack-cinder \ + automaton \ + && yum clean all + + {% elif base_distro in ['ubuntu', 'debian'] %} + +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + + {% endif %} +{% elif install_type == 'source' %} + +ADD ./cinder.tar / +RUN ln -s /cinder-* /cinder + +RUN cd /cinder \ + && useradd --user-group cinder \ + && pip install -r requirements.txt \ + && pip install /cinder \ + && mkdir /etc/cinder /var/log/cinder \ + && cp -r /cinder/etc/cinder/* /etc/cinder/ \ + && cp /etc/cinder/cinder.conf.sample /etc/cinder/cinder.conf \ + && chown -R cinder: /etc/cinder /var/log/cinder \ + && rm -rf /root/.cache + +{% endif %} diff --git a/docker_templates/cinder/cinder-base/build b/docker_templates/cinder/cinder-base/build new file mode 120000 index 0000000000..43944faa00 --- /dev/null +++ b/docker_templates/cinder/cinder-base/build @@ -0,0 +1 @@ +../../../tools/build-docker-image \ No newline at end of file diff --git a/docker_templates/cinder/cinder-data/Dockerfile.j2 b/docker_templates/cinder/cinder-data/Dockerfile.j2 new file mode 100644 index 0000000000..fd45dd31d3 --- /dev/null +++ b/docker_templates/cinder/cinder-data/Dockerfile.j2 @@ -0,0 +1,9 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-cinder-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN mkdir -p /opt/data +VOLUME [ "/opt/data" ] + +# Command needed to start the data container. +# Note: data containers do not need to be persistent. +CMD ["/bin/true"] diff --git a/docker_templates/cinder/cinder-data/build b/docker_templates/cinder/cinder-data/build new file mode 120000 index 0000000000..43944faa00 --- /dev/null +++ b/docker_templates/cinder/cinder-data/build @@ -0,0 +1 @@ +../../../tools/build-docker-image \ No newline at end of file diff --git a/docker_templates/cinder/cinder-scheduler/Dockerfile.j2 b/docker_templates/cinder/cinder-scheduler/Dockerfile.j2 new file mode 100644 index 0000000000..8ef8c045af --- /dev/null +++ b/docker_templates/cinder/cinder-scheduler/Dockerfile.j2 @@ -0,0 +1,7 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-cinder-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +COPY ./start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker_templates/cinder/cinder-scheduler/build b/docker_templates/cinder/cinder-scheduler/build new file mode 120000 index 0000000000..43944faa00 --- /dev/null +++ b/docker_templates/cinder/cinder-scheduler/build @@ -0,0 +1 @@ +../../../tools/build-docker-image \ No newline at end of file diff --git a/docker_templates/cinder/cinder-scheduler/config-external.sh b/docker_templates/cinder/cinder-scheduler/config-external.sh new file mode 120000 index 0000000000..5039b81258 --- /dev/null +++ b/docker_templates/cinder/cinder-scheduler/config-external.sh @@ -0,0 +1 @@ +../../../docker/common/cinder/cinder-scheduler/config-external.sh \ No newline at end of file diff --git a/docker_templates/cinder/cinder-scheduler/start.sh b/docker_templates/cinder/cinder-scheduler/start.sh new file mode 120000 index 0000000000..352594b0a8 --- /dev/null +++ b/docker_templates/cinder/cinder-scheduler/start.sh @@ -0,0 +1 @@ +../../../docker/common/cinder/cinder-scheduler/start.sh \ No newline at end of file diff --git a/docker_templates/cinder/cinder-volume/Dockerfile.j2 b/docker_templates/cinder/cinder-volume/Dockerfile.j2 new file mode 100644 index 0000000000..3e708be8a3 --- /dev/null +++ b/docker_templates/cinder/cinder-volume/Dockerfile.j2 @@ -0,0 +1,17 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-cinder-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %} + +RUN yum install -y lvm2 \ + scsi-target-utils \ + && yum clean all + + {% endif %} +{% endif %} + +COPY ./start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker_templates/cinder/cinder-volume/build b/docker_templates/cinder/cinder-volume/build new file mode 120000 index 0000000000..43944faa00 --- /dev/null +++ b/docker_templates/cinder/cinder-volume/build @@ -0,0 +1 @@ +../../../tools/build-docker-image \ No newline at end of file diff --git a/docker_templates/cinder/cinder-volume/config-external.sh b/docker_templates/cinder/cinder-volume/config-external.sh new file mode 120000 index 0000000000..a792ffcf75 --- /dev/null +++ b/docker_templates/cinder/cinder-volume/config-external.sh @@ -0,0 +1 @@ +../../../docker/common/cinder/cinder-volume/config-external.sh \ No newline at end of file diff --git a/docker_templates/cinder/cinder-volume/start.sh b/docker_templates/cinder/cinder-volume/start.sh new file mode 120000 index 0000000000..1358e133b9 --- /dev/null +++ b/docker_templates/cinder/cinder-volume/start.sh @@ -0,0 +1 @@ +../../../docker/common/cinder/cinder-volume/start.sh \ No newline at end of file