aboutsummaryrefslogtreecommitdiff
path: root/docker/swift/swift-container-server
diff options
context:
space:
mode:
Diffstat (limited to 'docker/swift/swift-container-server')
-rw-r--r--docker/swift/swift-container-server/Dockerfile.j219
-rw-r--r--docker/swift/swift-container-server/config-external.sh21
-rwxr-xr-xdocker/swift/swift-container-server/start.sh16
3 files changed, 56 insertions, 0 deletions
diff --git a/docker/swift/swift-container-server/Dockerfile.j2 b/docker/swift/swift-container-server/Dockerfile.j2
new file mode 100644
index 000000000..1a08c0f5d
--- /dev/null
+++ b/docker/swift/swift-container-server/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-swift-container \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/swift/swift-container-server/config-external.sh b/docker/swift/swift-container-server/config-external.sh
new file mode 100644
index 000000000..d81ba6cc4
--- /dev/null
+++ b/docker/swift/swift-container-server/config-external.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+OWNER="swift"
+
+if [[ -f "/opt/kolla/swift/swift.conf" ]]; then
+ cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf
+ chown ${OWNER}: /etc/swift/swift.conf
+ chmod 0640 /etc/swift/swift.conf
+fi
+
+if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then
+ cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz
+ chown ${OWNER}: /etc/swift/container.ring.gz
+ chmod 0640 /etc/swift/container.ring.gz
+fi
+
+if [[ -f "/opt/kolla/swift-container-server/container-server.conf" ]]; then
+ cp /opt/kolla/swift-container-server/container-server.conf /etc/swift/container-server.conf
+ chown ${OWNER}: /etc/swift/container-server.conf
+ chmod 0640 /etc/swift/container-server.conf
+fi
diff --git a/docker/swift/swift-container-server/start.sh b/docker/swift/swift-container-server/start.sh
new file mode 100755
index 000000000..78070ab29
--- /dev/null
+++ b/docker/swift/swift-container-server/start.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/swift-container-server"
+ARGS="/etc/swift/container-server.conf --verbose"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+source /opt/kolla/config-swift.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS