aboutsummaryrefslogtreecommitdiff
path: root/docker/magnum
diff options
context:
space:
mode:
authorSam Yaple <sam@yaple.net>2015-08-28 12:16:53 +0000
committerSam Yaple <sam@yaple.net>2015-08-28 13:33:50 +0000
commitcbd42ca6e90cca2ff4b84f5e4e46224e6455e8b2 (patch)
tree2e4256b6b7b8339da11b1d17250378596e61605b /docker/magnum
parent3b5380ade021c9884551f427441cbfc0122eb0f0 (diff)
downloadkolla-cbd42ca6e90cca2ff4b84f5e4e46224e6455e8b2.tar.gz
kolla-cbd42ca6e90cca2ff4b84f5e4e46224e6455e8b2.zip
Move docker_templates to docker dir
Updated build.py to reflect this change. Deprecate --template option and make it a noop. Change-Id: I7cd98d1ee684a4c64984a49597159868152683b2 Partially-Implements: blueprint remove-docker-dir
Diffstat (limited to 'docker/magnum')
-rw-r--r--docker/magnum/magnum-api/Dockerfile.j219
-rw-r--r--docker/magnum/magnum-api/config-external.sh10
-rwxr-xr-xdocker/magnum/magnum-api/start.sh20
-rw-r--r--docker/magnum/magnum-base/Dockerfile.j229
-rw-r--r--docker/magnum/magnum-conductor/Dockerfile.j223
-rw-r--r--docker/magnum/magnum-conductor/config-external.sh10
-rwxr-xr-xdocker/magnum/magnum-conductor/start.sh14
7 files changed, 125 insertions, 0 deletions
diff --git a/docker/magnum/magnum-api/Dockerfile.j2 b/docker/magnum/magnum-api/Dockerfile.j2
new file mode 100644
index 000000000..e208a115e
--- /dev/null
+++ b/docker/magnum/magnum-api/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-magnum-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-magnum-api \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+
+{{ include_footer }}
diff --git a/docker/magnum/magnum-api/config-external.sh b/docker/magnum/magnum-api/config-external.sh
new file mode 100644
index 000000000..573043f7d
--- /dev/null
+++ b/docker/magnum/magnum-api/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/magnum/magnum-api/magnum.conf"
+TARGET="/etc/magnum/magnum.conf"
+OWNER="magnum"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/magnum/magnum-api/start.sh b/docker/magnum/magnum-api/start.sh
new file mode 100755
index 000000000..ed154e29a
--- /dev/null
+++ b/docker/magnum/magnum-api/start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -o errexit
+CMD="/usr/bin/magnum-api"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/sh -c "magnum-manage db_sync" magnum
+ exit 0
+fi
+
+exec $CMD $ARGS
diff --git a/docker/magnum/magnum-base/Dockerfile.j2 b/docker/magnum/magnum-base/Dockerfile.j2
new file mode 100644
index 000000000..59c22f57e
--- /dev/null
+++ b/docker/magnum/magnum-base/Dockerfile.j2
@@ -0,0 +1,29 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos'] %}
+
+RUN curl https://copr.fedoraproject.org/coprs/sdake/openstack-magnum/repo/epel-7/sdake-openstack-magnum-epel-7.repo -o /etc/yum.repos.d/sdake-openstack-magnum-epel-7.repo
+
+ {% elif base_distro in ['fedora'] %}
+
+RUN curl https://copr.fedoraproject.org/coprs/sdake/openstack-magnum/repo/fedora-22/sdake-openstack-magnum-fedora-22.repo -o /etc/yum.repos.d/sdake-openstack-magnum-f22.repo
+
+ {% elif base_distro in ['ubuntu', 'debian', 'oraclelinux'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+
+ADD magnum.tar /
+RUN ln -s /magnum-* magnum \
+ && useradd --user-group magnum \
+ && pip --no-cache-dir install /magnum \
+ && mkdir -p /etc/magnum /var/log/magnum /home/magnum \
+ && cp -r /magnum/etc/* /etc/magnum/ \
+ && chown -R magnum: /etc/magnum /var/log/magnum /home/magnum
+
+{% endif %}
diff --git a/docker/magnum/magnum-conductor/Dockerfile.j2 b/docker/magnum/magnum-conductor/Dockerfile.j2
new file mode 100644
index 000000000..c14370085
--- /dev/null
+++ b/docker/magnum/magnum-conductor/Dockerfile.j2
@@ -0,0 +1,23 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-magnum-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-magnum-conductor \
+ tar \
+ && yum clean all
+
+# Install kubectl binary (ugh)
+RUN cd /tmp && curl -L https://github.com/GoogleCloudPlatform/kubernetes/releases/download/v0.15.0/kubernetes.tar.gz -o /tmp/kubernetes.tar.gz && /usr/bin/tar -xzvf /tmp/kubernetes.tar.gz && cp -a /tmp/kubernetes/platforms/linux/amd64/kubectl /usr/bin/kubectl && rm -rf /tmp/kubernetes
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+
+{{ include_footer }}
diff --git a/docker/magnum/magnum-conductor/config-external.sh b/docker/magnum/magnum-conductor/config-external.sh
new file mode 100644
index 000000000..b96e3179e
--- /dev/null
+++ b/docker/magnum/magnum-conductor/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/magnum/magnum-conductor/magnum.conf"
+TARGET="/etc/magnum/magnum.conf"
+OWNER="magnum"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/magnum/magnum-conductor/start.sh b/docker/magnum/magnum-conductor/start.sh
new file mode 100755
index 000000000..a5c76ee85
--- /dev/null
+++ b/docker/magnum/magnum-conductor/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/magnum-conductor"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS