summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Yaple <sam@yaple.net>2015-09-30 11:23:39 +0000
committerSam Yaple <sam@yaple.net>2015-10-06 03:30:26 +0000
commitcb4e875ae1e1ec2e6ddf8a6b37f42283697fd50c (patch)
treeda1028203186b45f869828dc5b4d17c13fadea94
parent3a56ce182662bcc9cf753024275034907ea36032 (diff)
downloadkolla-cb4e875ae1e1ec2e6ddf8a6b37f42283697fd50c.tar.gz
kolla-cb4e875ae1e1ec2e6ddf8a6b37f42283697fd50c.zip
Common start.sh
The majority of the start.sh code is identical. This removes that duplicate code while still maintaining the ability to call code in a specific container. The start.sh is moved into /usr/local/bin/kolla_start in the container The extend_start.sh script is called by the kolla_start script at the location /usr/local/bin/kolla_extend_start . It always exists because we create a noop kolla_extend_start in the base directory. We override it with extend_start.sh in a specific image should we need to. Of note, the neutron-agents container is exempt from this new structure due to it being a fat container. Additionally, we fix the inconsistent permissions throughout. 644 for repo files and the scripts are set to 755 via a Docker RUN command to ensure someones local perm change won't break upstream containers. Change-Id: I7da8d19965463ad30ee522a71183e3f092e0d6ad Closes-Bug: #1501295
-rw-r--r--docker/base/Dockerfile.j28
-rw-r--r--docker/base/kolla-common.sh5
-rw-r--r--docker/base/start.sh13
-rw-r--r--docker/ceilometer/ceilometer-alarm/Dockerfile.j25
-rwxr-xr-xdocker/ceilometer/ceilometer-alarm/start.sh10
-rw-r--r--docker/ceilometer/ceilometer-api/Dockerfile.j29
-rw-r--r--[-rwxr-xr-x]docker/ceilometer/ceilometer-api/extend_start.sh (renamed from docker/ceilometer/ceilometer-api/start.sh)9
-rw-r--r--docker/ceilometer/ceilometer-central/Dockerfile.j27
-rwxr-xr-xdocker/ceilometer/ceilometer-central/start.sh10
-rw-r--r--docker/ceilometer/ceilometer-collector/Dockerfile.j27
-rwxr-xr-xdocker/ceilometer/ceilometer-collector/start.sh10
-rw-r--r--docker/ceilometer/ceilometer-compute/Dockerfile.j214
-rwxr-xr-xdocker/ceilometer/ceilometer-compute/start.sh10
-rw-r--r--docker/ceilometer/ceilometer-notification/Dockerfile.j25
-rwxr-xr-xdocker/ceilometer/ceilometer-notification/start.sh10
-rw-r--r--docker/ceph/ceph-mon/Dockerfile.j24
-rw-r--r--[-rwxr-xr-x]docker/ceph/ceph-mon/extend_start.sh (renamed from docker/ceph/ceph-mon/start.sh)6
-rw-r--r--[-rwxr-xr-x]docker/ceph/ceph-mon/fetch_ceph_keys.py0
-rw-r--r--docker/ceph/ceph-osd/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/ceph/ceph-osd/extend_start.sh (renamed from docker/ceph/ceph-osd/start.sh)6
-rw-r--r--docker/cinder/cinder-api/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/cinder/cinder-api/extend_start.sh (renamed from docker/cinder/cinder-api/start.sh)5
-rw-r--r--docker/cinder/cinder-backup/Dockerfile.j24
-rwxr-xr-xdocker/cinder/cinder-backup/start.sh7
-rw-r--r--docker/cinder/cinder-scheduler/Dockerfile.j24
-rwxr-xr-xdocker/cinder/cinder-scheduler/start.sh7
-rw-r--r--docker/cinder/cinder-volume/Dockerfile.j211
-rwxr-xr-xdocker/cinder/cinder-volume/start.sh7
-rw-r--r--docker/designate/designate-api/Dockerfile.j26
-rw-r--r--[-rwxr-xr-x]docker/designate/designate-api/extend_start.sh (renamed from docker/designate/designate-api/start.sh)9
-rw-r--r--docker/designate/designate-backend-bind9/Dockerfile.j25
-rwxr-xr-xdocker/designate/designate-backend-bind9/start.sh10
-rw-r--r--docker/designate/designate-central/Dockerfile.j28
-rwxr-xr-xdocker/designate/designate-central/start.sh10
-rw-r--r--docker/designate/designate-mdns/Dockerfile.j25
-rwxr-xr-xdocker/designate/designate-mdns/start.sh10
-rw-r--r--docker/designate/designate-poolmanager/Dockerfile.j29
-rwxr-xr-xdocker/designate/designate-poolmanager/start.sh10
-rw-r--r--docker/designate/designate-sink/Dockerfile.j29
-rwxr-xr-xdocker/designate/designate-sink/start.sh10
-rw-r--r--docker/glance/glance-api/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/glance/glance-api/extend_start.sh (renamed from docker/glance/glance-api/start.sh)6
-rw-r--r--docker/glance/glance-registry/Dockerfile.j24
-rwxr-xr-xdocker/glance/glance-registry/start.sh7
-rw-r--r--docker/gnocchi/gnocchi-api/Dockerfile.j26
-rw-r--r--[-rwxr-xr-x]docker/gnocchi/gnocchi-api/extend_start.sh (renamed from docker/gnocchi/gnocchi-api/start.sh)10
-rw-r--r--docker/gnocchi/gnocchi-statsd/Dockerfile.j25
-rwxr-xr-xdocker/gnocchi/gnocchi-statsd/start.sh11
-rw-r--r--docker/haproxy/Dockerfile.j24
-rw-r--r--[-rwxr-xr-x]docker/haproxy/ensure_latest_config.sh0
-rw-r--r--[-rwxr-xr-x]docker/haproxy/extend_start.sh (renamed from docker/haproxy/start.sh)9
-rw-r--r--docker/heat/heat-api-cfn/Dockerfile.j24
-rwxr-xr-xdocker/heat/heat-api-cfn/start.sh7
-rw-r--r--docker/heat/heat-api/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/heat/heat-api/extend_start.sh (renamed from docker/heat/heat-api/start.sh)6
-rw-r--r--docker/heat/heat-engine/Dockerfile.j24
-rw-r--r--docker/horizon/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/horizon/extend_start.sh (renamed from docker/horizon/start.sh)6
-rw-r--r--docker/ironic/ironic-api/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/ironic/ironic-api/extend_start.sh (renamed from docker/ironic/ironic-api/start.sh)5
-rw-r--r--docker/ironic/ironic-conductor/Dockerfile.j24
-rwxr-xr-xdocker/ironic/ironic-conductor/start.sh6
-rw-r--r--docker/ironic/ironic-discoverd/Dockerfile.j24
-rwxr-xr-xdocker/ironic/ironic-discoverd/start.sh6
-rw-r--r--docker/ironic/ironic-pxe/Dockerfile.j23
-rwxr-xr-xdocker/ironic/ironic-pxe/start.sh6
-rw-r--r--docker/keepalived/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/keepalived/check_alive.sh0
-rw-r--r--[-rwxr-xr-x]docker/keepalived/extend_start.sh (renamed from docker/keepalived/start.sh)6
-rw-r--r--docker/keystone/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/keystone/extend_start.sh (renamed from docker/keystone/start.sh)6
-rw-r--r--[-rwxr-xr-x]docker/logging/rsyslog/Dockerfile.j213
-rwxr-xr-xdocker/logging/rsyslog/start.sh7
-rw-r--r--docker/magnum/magnum-api/Dockerfile.j29
-rw-r--r--[-rwxr-xr-x]docker/magnum/magnum-api/extend_start.sh (renamed from docker/magnum/magnum-api/start.sh)9
-rw-r--r--docker/magnum/magnum-conductor/Dockerfile.j213
-rwxr-xr-xdocker/magnum/magnum-conductor/start.sh10
-rw-r--r--docker/mariadb/Dockerfile.j26
-rw-r--r--[-rwxr-xr-x]docker/mariadb/extend_start.sh (renamed from docker/mariadb/config-galera.sh)10
-rwxr-xr-xdocker/mariadb/start.sh20
-rw-r--r--docker/memcached/Dockerfile.j24
-rwxr-xr-xdocker/memcached/start.sh7
-rw-r--r--docker/mongodb/Dockerfile.j26
-rw-r--r--docker/murano/murano-api/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/murano/murano-api/extend_start.sh (renamed from docker/murano/murano-api/start.sh)6
-rw-r--r--docker/murano/murano-engine/Dockerfile.j24
-rwxr-xr-xdocker/murano/murano-engine/start.sh7
-rw-r--r--docker/neutron/neutron-agents/Dockerfile.j21
-rw-r--r--docker/neutron/neutron-agents/config-sudoers.sh (renamed from docker/neutron/neutron-base/config-sudoers.sh)0
-rwxr-xr-xdocker/neutron/neutron-agents/start.sh4
-rw-r--r--docker/neutron/neutron-base/Dockerfile.j23
-rw-r--r--docker/neutron/neutron-base/extend_start.sh11
-rw-r--r--[-rwxr-xr-x]docker/neutron/neutron-base/ip_wrapper.py4
-rw-r--r--docker/neutron/neutron-linuxbridge-agent/Dockerfile.j27
-rwxr-xr-xdocker/neutron/neutron-linuxbridge-agent/start.sh8
-rw-r--r--docker/neutron/neutron-openvswitch-agent/Dockerfile.j27
-rwxr-xr-xdocker/neutron/neutron-openvswitch-agent/start.sh8
-rw-r--r--docker/neutron/neutron-server/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/neutron/neutron-server/extend_start.sh (renamed from docker/neutron/neutron-server/start.sh)14
-rw-r--r--docker/nova/nova-api/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/nova/nova-api/extend_start.sh (renamed from docker/nova/nova-api/start.sh)6
-rw-r--r--docker/nova/nova-compute/Dockerfile.j27
-rwxr-xr-xdocker/nova/nova-compute/start.sh7
-rw-r--r--docker/nova/nova-conductor/Dockerfile.j27
-rwxr-xr-xdocker/nova/nova-conductor/start.sh7
-rw-r--r--docker/nova/nova-consoleauth/Dockerfile.j24
-rwxr-xr-xdocker/nova/nova-consoleauth/start.sh7
-rw-r--r--docker/nova/nova-libvirt/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/nova/nova-libvirt/extend_start.sh (renamed from docker/nova/nova-libvirt/start.sh)6
-rw-r--r--docker/nova/nova-network/Dockerfile.j24
-rwxr-xr-xdocker/nova/nova-network/start.sh7
-rw-r--r--docker/nova/nova-novncproxy/Dockerfile.j24
-rwxr-xr-xdocker/nova/nova-novncproxy/start.sh7
-rw-r--r--docker/nova/nova-scheduler/Dockerfile.j24
-rwxr-xr-xdocker/nova/nova-scheduler/start.sh7
-rw-r--r--docker/openvswitch/openvswitch-db-server/Dockerfile.j25
-rw-r--r--[-rwxr-xr-x]docker/openvswitch/openvswitch-db-server/extend_start.sh (renamed from docker/openvswitch/openvswitch-db-server/start.sh)6
-rw-r--r--docker/openvswitch/openvswitch-vswitchd/Dockerfile.j24
-rw-r--r--docker/openvswitch/openvswitch-vswitchd/extend_start.sh3
-rw-r--r--[-rwxr-xr-x]docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh0
-rwxr-xr-xdocker/openvswitch/openvswitch-vswitchd/start.sh9
-rw-r--r--docker/rabbitmq/Dockerfile.j26
-rw-r--r--docker/rabbitmq/config-rabbit.sh7
-rw-r--r--[-rwxr-xr-x]docker/rabbitmq/extend_start.sh (renamed from docker/heat/heat-engine/start.sh)10
-rwxr-xr-xdocker/rabbitmq/start.sh14
-rw-r--r--docker/swift/swift-account-auditor/Dockerfile.j27
-rwxr-xr-xdocker/swift/swift-account-auditor/start.sh7
-rw-r--r--docker/swift/swift-account-reaper/Dockerfile.j27
-rwxr-xr-xdocker/swift/swift-account-reaper/start.sh7
-rw-r--r--docker/swift/swift-account-replicator/Dockerfile.j27
-rwxr-xr-xdocker/swift/swift-account-replicator/start.sh7
-rw-r--r--docker/swift/swift-account-server/Dockerfile.j27
-rwxr-xr-xdocker/swift/swift-account-server/start.sh7
-rw-r--r--[-rwxr-xr-x]docker/swift/swift-base/config-swift.sh0
-rw-r--r--docker/swift/swift-container-auditor/Dockerfile.j27
-rwxr-xr-xdocker/swift/swift-container-auditor/start.sh7
-rw-r--r--docker/swift/swift-container-replicator/Dockerfile.j27
-rwxr-xr-xdocker/swift/swift-container-replicator/start.sh7
-rw-r--r--docker/swift/swift-container-server/Dockerfile.j27
-rwxr-xr-xdocker/swift/swift-container-server/start.sh7
-rw-r--r--docker/swift/swift-container-updater/Dockerfile.j27
-rwxr-xr-xdocker/swift/swift-container-updater/start.sh7
-rw-r--r--docker/swift/swift-object-auditor/Dockerfile.j24
-rwxr-xr-xdocker/swift/swift-object-auditor/start.sh7
-rw-r--r--docker/swift/swift-object-base/Dockerfile.j25
-rw-r--r--docker/swift/swift-object-base/config-swift-object.sh72
-rw-r--r--docker/swift/swift-object-expirer/Dockerfile.j24
-rwxr-xr-xdocker/swift/swift-object-expirer/start.sh7
-rw-r--r--docker/swift/swift-object-replicator/Dockerfile.j24
-rwxr-xr-xdocker/swift/swift-object-replicator/start.sh7
-rw-r--r--docker/swift/swift-object-server/Dockerfile.j24
-rwxr-xr-xdocker/swift/swift-object-server/start.sh7
-rw-r--r--docker/swift/swift-object-updater/Dockerfile.j24
-rwxr-xr-xdocker/swift/swift-object-updater/start.sh7
-rw-r--r--docker/swift/swift-proxy-server/Dockerfile.j27
-rw-r--r--docker/swift/swift-proxy-server/extend_start.sh3
-rwxr-xr-xdocker/swift/swift-proxy-server/start.sh8
-rw-r--r--docker/swift/swift-rsyncd/Dockerfile.j29
-rwxr-xr-xdocker/swift/swift-rsyncd/start.sh7
-rw-r--r--docker/zaqar/Dockerfile.j26
-rw-r--r--[-rwxr-xr-x]docker/zaqar/extend_start.sh (renamed from docker/zaqar/start.sh)9
161 files changed, 167 insertions, 961 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2
index 518491ccb..c17cfa25e 100644
--- a/docker/base/Dockerfile.j2
+++ b/docker/base/Dockerfile.j2
@@ -188,4 +188,10 @@ RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 199369E5404BD
{% endif %}
-COPY set_configs.py kolla-common.sh /opt/kolla/
+COPY set_configs.py /opt/kolla/
+
+COPY start.sh /usr/local/bin/kolla_start
+RUN touch /usr/local/bin/kolla_extend_start \
+ && chmod 755 /usr/local/bin/kolla_start /usr/local/bin/kolla_extend_start /opt/kolla/set_configs.py
+
+CMD ["kolla_start"]
diff --git a/docker/base/kolla-common.sh b/docker/base/kolla-common.sh
deleted file mode 100644
index 0cbb04821..000000000
--- a/docker/base/kolla-common.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-# Copying configs into place if needed and set run command
-python /opt/kolla/set_configs.py
-CMD=$(cat /run_command)
diff --git a/docker/base/start.sh b/docker/base/start.sh
new file mode 100644
index 000000000..7d89f636c
--- /dev/null
+++ b/docker/base/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -o errexit
+
+# Processing /opt/kolla/config_files/config.json
+python /opt/kolla/set_configs.py
+CMD=$(cat /run_command)
+ARGS=""
+
+# Run additional commands if present
+source kolla_extend_start
+
+echo "Running command: '${CMD}${ARGS:+ $ARGS}'"
+exec ${CMD} ${ARGS}
diff --git a/docker/ceilometer/ceilometer-alarm/Dockerfile.j2 b/docker/ceilometer/ceilometer-alarm/Dockerfile.j2
index f720ee15d..387c63ae1 100644
--- a/docker/ceilometer/ceilometer-alarm/Dockerfile.j2
+++ b/docker/ceilometer/ceilometer-alarm/Dockerfile.j2
@@ -10,9 +10,4 @@ RUN yum install -y openstack-ceilometer-alarm \
{% endif %}
{% endif %}
-COPY ./start.sh /
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-alarm/start.sh b/docker/ceilometer/ceilometer-alarm/start.sh
deleted file mode 100755
index d98577e08..000000000
--- a/docker/ceilometer/ceilometer-alarm/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/ceilometer-alarm"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/ceilometer/ceilometer-api/Dockerfile.j2 b/docker/ceilometer/ceilometer-api/Dockerfile.j2
index 7470a9026..0519d6f0f 100644
--- a/docker/ceilometer/ceilometer-api/Dockerfile.j2
+++ b/docker/ceilometer/ceilometer-api/Dockerfile.j2
@@ -4,16 +4,13 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-
RUN yum install -y openstack-ceilometer-api \
- && yum clean all
+ && yum clean all
{% endif %}
{% endif %}
-COPY ./start.sh /
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-api/start.sh b/docker/ceilometer/ceilometer-api/extend_start.sh
index 6ba3cc37d..afe612ae6 100755..100644
--- a/docker/ceilometer/ceilometer-api/start.sh
+++ b/docker/ceilometer/ceilometer-api/extend_start.sh
@@ -1,11 +1,4 @@
#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/ceilometer-api"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -13,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "ceilometer-manage db_sync" ceilometer
exit 0
fi
-
-exec $CMD $ARGS
diff --git a/docker/ceilometer/ceilometer-central/Dockerfile.j2 b/docker/ceilometer/ceilometer-central/Dockerfile.j2
index 3b2e9a2c0..01447126e 100644
--- a/docker/ceilometer/ceilometer-central/Dockerfile.j2
+++ b/docker/ceilometer/ceilometer-central/Dockerfile.j2
@@ -5,14 +5,9 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y openstack-ceilometer-central \
- && yum clean all
+ && yum clean all
{% endif %}
{% endif %}
-COPY ./start.sh /
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-central/start.sh b/docker/ceilometer/ceilometer-central/start.sh
deleted file mode 100755
index e074febc9..000000000
--- a/docker/ceilometer/ceilometer-central/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/ceilometer-agent-central"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/ceilometer/ceilometer-collector/Dockerfile.j2 b/docker/ceilometer/ceilometer-collector/Dockerfile.j2
index c5cf80d45..21509cb94 100644
--- a/docker/ceilometer/ceilometer-collector/Dockerfile.j2
+++ b/docker/ceilometer/ceilometer-collector/Dockerfile.j2
@@ -5,14 +5,9 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y openstack-ceilometer-collector \
- && yum clean all
+ && yum clean all
{% endif %}
{% endif %}
-COPY ./start.sh /
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-collector/start.sh b/docker/ceilometer/ceilometer-collector/start.sh
deleted file mode 100755
index 585e4d7f5..000000000
--- a/docker/ceilometer/ceilometer-collector/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/ceilometer-collector"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/ceilometer/ceilometer-compute/Dockerfile.j2 b/docker/ceilometer/ceilometer-compute/Dockerfile.j2
index dd6bc62af..d2f75134d 100644
--- a/docker/ceilometer/ceilometer-compute/Dockerfile.j2
+++ b/docker/ceilometer/ceilometer-compute/Dockerfile.j2
@@ -4,17 +4,13 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum install -y openstack-ceilometer-compute \
- python-ceilometerclient \
- python-pecan \
- && yum clean all
+RUN yum install -y \
+ openstack-ceilometer-compute \
+ python-ceilometerclient \
+ python-pecan \
+ && yum clean all
{% endif %}
{% endif %}
-COPY ./start.sh /
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-compute/start.sh b/docker/ceilometer/ceilometer-compute/start.sh
deleted file mode 100755
index f17a32709..000000000
--- a/docker/ceilometer/ceilometer-compute/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/ceilometer-agent-compute"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/ceilometer/ceilometer-notification/Dockerfile.j2 b/docker/ceilometer/ceilometer-notification/Dockerfile.j2
index 571166443..503e7ee7d 100644
--- a/docker/ceilometer/ceilometer-notification/Dockerfile.j2
+++ b/docker/ceilometer/ceilometer-notification/Dockerfile.j2
@@ -10,9 +10,4 @@ RUN yum install -y openstack-ceilometer-notification \
{% endif %}
{% endif %}
-COPY ./start.sh /
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-notification/start.sh b/docker/ceilometer/ceilometer-notification/start.sh
deleted file mode 100755
index a3421acaf..000000000
--- a/docker/ceilometer/ceilometer-notification/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/ceilometer-agent-notification"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/ceph/ceph-mon/Dockerfile.j2 b/docker/ceph/ceph-mon/Dockerfile.j2
index 57d31e819..bfcb8a1c6 100644
--- a/docker/ceph/ceph-mon/Dockerfile.j2
+++ b/docker/ceph/ceph-mon/Dockerfile.j2
@@ -1,7 +1,7 @@
FROM {{ namespace }}/{{ image_prefix }}ceph-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-COPY start.sh /
COPY fetch_ceph_keys.py /usr/bin/
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start /usr/bin/fetch_ceph_keys.py
diff --git a/docker/ceph/ceph-mon/start.sh b/docker/ceph/ceph-mon/extend_start.sh
index 29b2bd700..dce6749b3 100755..100644
--- a/docker/ceph/ceph-mon/start.sh
+++ b/docker/ceph/ceph-mon/extend_start.sh
@@ -1,5 +1,4 @@
#!/bin/bash
-set -o errexit
# Setup common paths
KEYRING_ADMIN="/etc/ceph/ceph.client.admin.keyring"
@@ -7,9 +6,6 @@ KEYRING_MON="/etc/ceph/ceph.client.mon.keyring"
MONMAP="/etc/ceph/ceph.monmap"
MON_DIR="/var/lib/ceph/mon/ceph-$(hostname)"
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
# 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
@@ -37,5 +33,3 @@ if [[ ! -e "${MON_DIR}/keyring" ]]; then
ceph-mon --mkfs -i "$(hostname)" --monmap "${MONMAP}" --keyring "${KEYRING_TMP}"
rm "${KEYRING_TMP}"
fi
-
-exec $CMD
diff --git a/docker/ceph/ceph-mon/fetch_ceph_keys.py b/docker/ceph/ceph-mon/fetch_ceph_keys.py
index ab2be9c16..ab2be9c16 100755..100644
--- a/docker/ceph/ceph-mon/fetch_ceph_keys.py
+++ b/docker/ceph/ceph-mon/fetch_ceph_keys.py
diff --git a/docker/ceph/ceph-osd/Dockerfile.j2 b/docker/ceph/ceph-osd/Dockerfile.j2
index ac453ce88..260f98698 100644
--- a/docker/ceph/ceph-osd/Dockerfile.j2
+++ b/docker/ceph/ceph-osd/Dockerfile.j2
@@ -1,6 +1,5 @@
FROM {{ namespace }}/{{ image_prefix }}ceph-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
diff --git a/docker/ceph/ceph-osd/start.sh b/docker/ceph/ceph-osd/extend_start.sh
index 4b26c426b..a63b97b3c 100755..100644
--- a/docker/ceph/ceph-osd/start.sh
+++ b/docker/ceph/ceph-osd/extend_start.sh
@@ -1,8 +1,4 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -44,5 +40,3 @@ fi
JOURNAL_PARTITION=$(ls "${OSD_DEV}"* | egrep "${OSD_DEV}p?2")
OSD_DIR="/var/lib/ceph/osd/ceph-${OSD_ID}"
ARGS="-i ${OSD_ID} --osd-journal ${JOURNAL_PARTITION} -k ${OSD_DIR}/keyring"
-
-exec $CMD $ARGS
diff --git a/docker/cinder/cinder-api/Dockerfile.j2 b/docker/cinder/cinder-api/Dockerfile.j2
index 4c481a45f..59d20cd80 100644
--- a/docker/cinder/cinder-api/Dockerfile.j2
+++ b/docker/cinder/cinder-api/Dockerfile.j2
@@ -10,8 +10,7 @@ RUN yum install -y python-keystone \
{% endif %}
{% endif %}
-COPY ./start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/cinder/cinder-api/start.sh b/docker/cinder/cinder-api/extend_start.sh
index 553158a82..9cf68ae86 100755..100644
--- a/docker/cinder/cinder-api/start.sh
+++ b/docker/cinder/cinder-api/extend_start.sh
@@ -1,14 +1,9 @@
#!/bin/bash
set -o errexit
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
# 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 "cinder-manage db sync" cinder
exit 0
fi
-
-exec $CMD
diff --git a/docker/cinder/cinder-backup/Dockerfile.j2 b/docker/cinder/cinder-backup/Dockerfile.j2
index 14794b053..6d266f46b 100644
--- a/docker/cinder/cinder-backup/Dockerfile.j2
+++ b/docker/cinder/cinder-backup/Dockerfile.j2
@@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-COPY ./start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/cinder/cinder-backup/start.sh b/docker/cinder/cinder-backup/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/cinder/cinder-backup/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/cinder/cinder-scheduler/Dockerfile.j2 b/docker/cinder/cinder-scheduler/Dockerfile.j2
index 14794b053..6d266f46b 100644
--- a/docker/cinder/cinder-scheduler/Dockerfile.j2
+++ b/docker/cinder/cinder-scheduler/Dockerfile.j2
@@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-COPY ./start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/cinder/cinder-scheduler/start.sh b/docker/cinder/cinder-scheduler/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/cinder/cinder-scheduler/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/cinder/cinder-volume/Dockerfile.j2 b/docker/cinder/cinder-volume/Dockerfile.j2
index 4eda4b981..5047124be 100644
--- a/docker/cinder/cinder-volume/Dockerfile.j2
+++ b/docker/cinder/cinder-volume/Dockerfile.j2
@@ -4,15 +4,12 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum install -y lvm2 \
- scsi-target-utils \
- && yum clean all
+RUN yum install -y \
+ lvm2 \
+ scsi-target-utils \
+ && yum clean all
{% endif %}
{% endif %}
-COPY ./start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/cinder/cinder-volume/start.sh b/docker/cinder/cinder-volume/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/cinder/cinder-volume/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/designate/designate-api/Dockerfile.j2 b/docker/designate/designate-api/Dockerfile.j2
index f0b8ea6cf..4f7e25634 100644
--- a/docker/designate/designate-api/Dockerfile.j2
+++ b/docker/designate/designate-api/Dockerfile.j2
@@ -11,9 +11,7 @@ RUN yum install -y \
{% endif %}
{% endif %}
-COPY start.sh /start.sh
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/designate/designate-api/start.sh b/docker/designate/designate-api/extend_start.sh
index 816715fa9..8fda9197b 100755..100644
--- a/docker/designate/designate-api/start.sh
+++ b/docker/designate/designate-api/extend_start.sh
@@ -1,11 +1,4 @@
#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/designate-api"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -13,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "designate-manage db_sync" designate
exit 0
fi
-
-exec $CMD $ARGS
diff --git a/docker/designate/designate-backend-bind9/Dockerfile.j2 b/docker/designate/designate-backend-bind9/Dockerfile.j2
index f163c7b98..843209214 100644
--- a/docker/designate/designate-backend-bind9/Dockerfile.j2
+++ b/docker/designate/designate-backend-bind9/Dockerfile.j2
@@ -11,9 +11,4 @@ RUN yum install -y bind \
{% endif %}
{% endif %}
-COPY start.sh /start.sh
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/designate/designate-backend-bind9/start.sh b/docker/designate/designate-backend-bind9/start.sh
deleted file mode 100755
index bd3f8c401..000000000
--- a/docker/designate/designate-backend-bind9/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/sbin/named"
-ARGS="-u named -g"
-
-# Execute config strategy
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/designate/designate-central/Dockerfile.j2 b/docker/designate/designate-central/Dockerfile.j2
index 01ddbbfd0..7ff039975 100644
--- a/docker/designate/designate-central/Dockerfile.j2
+++ b/docker/designate/designate-central/Dockerfile.j2
@@ -4,16 +4,10 @@ MAINTAINER Kolla Project (https://launchpad.net.kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum install -y \
- openstack-designate-central \
+RUN yum install -y openstack-designate-central \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /start.sh
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/designate/designate-central/start.sh b/docker/designate/designate-central/start.sh
deleted file mode 100755
index 760f7eacd..000000000
--- a/docker/designate/designate-central/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/designate-central"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/designate/designate-mdns/Dockerfile.j2 b/docker/designate/designate-mdns/Dockerfile.j2
index fdb2d0c1d..6c2125f30 100644
--- a/docker/designate/designate-mdns/Dockerfile.j2
+++ b/docker/designate/designate-mdns/Dockerfile.j2
@@ -10,9 +10,4 @@ RUN yum install -y openstack-designate-mdns \
{% endif %}
{% endif %}
-COPY start.sh /start.sh
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/designate/designate-mdns/start.sh b/docker/designate/designate-mdns/start.sh
deleted file mode 100755
index 026e8e6c3..000000000
--- a/docker/designate/designate-mdns/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/designate-mdns"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/designate/designate-poolmanager/Dockerfile.j2 b/docker/designate/designate-poolmanager/Dockerfile.j2
index 1d8df60ad..ad4b428d5 100644
--- a/docker/designate/designate-poolmanager/Dockerfile.j2
+++ b/docker/designate/designate-poolmanager/Dockerfile.j2
@@ -6,16 +6,11 @@ MAINTAINER Kolla Project (https://launchpad.net.kolla)
# The bind9 package here is only to provide the rndc binary.
RUN yum install -y \
- openstack-designate-pool-manager \
- bind \
+ openstack-designate-pool-manager \
+ bind \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /start.sh
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/designate/designate-poolmanager/start.sh b/docker/designate/designate-poolmanager/start.sh
deleted file mode 100755
index a648b9b37..000000000
--- a/docker/designate/designate-poolmanager/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/designate-pool-manager"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/designate/designate-sink/Dockerfile.j2 b/docker/designate/designate-sink/Dockerfile.j2
index bc4fa45c9..6c4a3ea40 100644
--- a/docker/designate/designate-sink/Dockerfile.j2
+++ b/docker/designate/designate-sink/Dockerfile.j2
@@ -5,16 +5,11 @@ MAINTAINER Kolla Project (https://launchpad.net.kolla)
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y \
- openstack-designate-sink \
- python-designateclient \
+ openstack-designate-sink \
+ python-designateclient \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /start.sh
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/designate/designate-sink/start.sh b/docker/designate/designate-sink/start.sh
deleted file mode 100755
index 94c70470c..000000000
--- a/docker/designate/designate-sink/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/designate-sink"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/glance/glance-api/Dockerfile.j2 b/docker/glance/glance-api/Dockerfile.j2
index c0bdc14e8..2e1aec4cd 100644
--- a/docker/glance/glance-api/Dockerfile.j2
+++ b/docker/glance/glance-api/Dockerfile.j2
@@ -1,8 +1,7 @@
FROM {{ namespace }}/{{ image_prefix }}glance-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/glance/glance-api/start.sh b/docker/glance/glance-api/extend_start.sh
index f4463c6fa..eebee43e4 100755..100644
--- a/docker/glance/glance-api/start.sh
+++ b/docker/glance/glance-api/extend_start.sh
@@ -1,8 +1,4 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -10,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "glance-manage db_sync" glance
exit 0
fi
-
-exec $CMD
diff --git a/docker/glance/glance-registry/Dockerfile.j2 b/docker/glance/glance-registry/Dockerfile.j2
index c0bdc14e8..54710da06 100644
--- a/docker/glance/glance-registry/Dockerfile.j2
+++ b/docker/glance/glance-registry/Dockerfile.j2
@@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}glance-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/glance/glance-registry/start.sh b/docker/glance/glance-registry/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/glance/glance-registry/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/gnocchi/gnocchi-api/Dockerfile.j2 b/docker/gnocchi/gnocchi-api/Dockerfile.j2
index b9479c1d7..00c079726 100644
--- a/docker/gnocchi/gnocchi-api/Dockerfile.j2
+++ b/docker/gnocchi/gnocchi-api/Dockerfile.j2
@@ -13,9 +13,7 @@ RUN yum install -y \
{% endif %}
{% endif %}
-COPY start.sh /
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/gnocchi/gnocchi-api/start.sh b/docker/gnocchi/gnocchi-api/extend_start.sh
index bb91fb831..8ca5d7388 100755..100644
--- a/docker/gnocchi/gnocchi-api/start.sh
+++ b/docker/gnocchi/gnocchi-api/extend_start.sh
@@ -1,11 +1,4 @@
#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/gnocchi-api"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -13,6 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "gnocchi-manage db_sync" gnocchi
exit 0
fi
-
-exec $CMD $ARGS
-
diff --git a/docker/gnocchi/gnocchi-statsd/Dockerfile.j2 b/docker/gnocchi/gnocchi-statsd/Dockerfile.j2
index b9fd0a52e..f569e165b 100644
--- a/docker/gnocchi/gnocchi-statsd/Dockerfile.j2
+++ b/docker/gnocchi/gnocchi-statsd/Dockerfile.j2
@@ -10,9 +10,4 @@ RUN yum install -y openstack-gnocchi-statsd \
{% endif %}
{% endif %}
-COPY start.sh /
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/gnocchi/gnocchi-statsd/start.sh b/docker/gnocchi/gnocchi-statsd/start.sh
deleted file mode 100755
index 6070a785a..000000000
--- a/docker/gnocchi/gnocchi-statsd/start.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/gnocchi-statsd"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
-
diff --git a/docker/haproxy/Dockerfile.j2 b/docker/haproxy/Dockerfile.j2
index fe02ce804..e7a4abddd 100644
--- a/docker/haproxy/Dockerfile.j2
+++ b/docker/haproxy/Dockerfile.j2
@@ -19,9 +19,9 @@ RUN apt-get install -y --no-install-recommends haproxy \
{% endif %}
-COPY start.sh /
COPY ensure_latest_config.sh /opt/kolla/
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start /opt/kolla/ensure_latest_config.sh
{{ include_footer }}
diff --git a/docker/haproxy/ensure_latest_config.sh b/docker/haproxy/ensure_latest_config.sh
index af20175a6..af20175a6 100755..100644
--- a/docker/haproxy/ensure_latest_config.sh
+++ b/docker/haproxy/ensure_latest_config.sh
diff --git a/docker/haproxy/start.sh b/docker/haproxy/extend_start.sh
index 3bdd4018a..cf50a5c9f 100755..100644
--- a/docker/haproxy/start.sh
+++ b/docker/haproxy/extend_start.sh
@@ -1,10 +1,6 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
# We are intentionally not using exec so we can reload the haproxy config later
+echo "Running command: '${CMD}'"
$CMD
# TODO(SamYaple): This has the potential for a race condition triggered by a
@@ -12,3 +8,6 @@ $CMD
while [[ -e "/proc/$(cat /run/haproxy.pid)" ]]; do
sleep 5
done
+
+# Based on the above loop this point should never be reached
+exit 1
diff --git a/docker/heat/heat-api-cfn/Dockerfile.j2 b/docker/heat/heat-api-cfn/Dockerfile.j2
index 7b4cb7d68..1146ee326 100644
--- a/docker/heat/heat-api-cfn/Dockerfile.j2
+++ b/docker/heat/heat-api-cfn/Dockerfile.j2
@@ -10,8 +10,4 @@ RUN yum -y install openstack-heat-api-cfn \
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/heat/heat-api-cfn/start.sh b/docker/heat/heat-api-cfn/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/heat/heat-api-cfn/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/heat/heat-api/Dockerfile.j2 b/docker/heat/heat-api/Dockerfile.j2
index 19eb89777..e425e4ebc 100644
--- a/docker/heat/heat-api/Dockerfile.j2
+++ b/docker/heat/heat-api/Dockerfile.j2
@@ -10,8 +10,7 @@ RUN yum -y install openstack-heat-api \
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/heat/heat-api/start.sh b/docker/heat/heat-api/extend_start.sh
index b451c604c..17bd742e3 100755..100644
--- a/docker/heat/heat-api/start.sh
+++ b/docker/heat/heat-api/extend_start.sh
@@ -1,8 +1,4 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -13,5 +9,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
openstack role add --domain heat_user_domain --user heat_domain_admin admin
exit 0
fi
-
-exec $CMD
diff --git a/docker/heat/heat-engine/Dockerfile.j2 b/docker/heat/heat-engine/Dockerfile.j2
index 3759788d1..1a0b9b1dc 100644
--- a/docker/heat/heat-engine/Dockerfile.j2
+++ b/docker/heat/heat-engine/Dockerfile.j2
@@ -15,8 +15,4 @@ RUN yum -y install \
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/horizon/Dockerfile.j2 b/docker/horizon/Dockerfile.j2
index 427dd5965..cc8c5876e 100644
--- a/docker/horizon/Dockerfile.j2
+++ b/docker/horizon/Dockerfile.j2
@@ -56,8 +56,7 @@ RUN ln -s horizon-source/* horizon \
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/horizon/start.sh b/docker/horizon/extend_start.sh
index 784ff5e87..7a0bf9b55 100755..100644
--- a/docker/horizon/start.sh
+++ b/docker/horizon/extend_start.sh
@@ -1,13 +1,7 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions
-source /opt/kolla/kolla-common.sh
if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
"${KOLLA_BASE_DISTRO}" == "debian" ]]; then
# Loading Apache2 ENV variables
source /etc/apache2/envvars
fi
-
-exec $CMD
diff --git a/docker/ironic/ironic-api/Dockerfile.j2 b/docker/ironic/ironic-api/Dockerfile.j2
index 016b3560b..6b726a419 100644
--- a/docker/ironic/ironic-api/Dockerfile.j2
+++ b/docker/ironic/ironic-api/Dockerfile.j2
@@ -13,8 +13,7 @@ RUN VER_TO_GET=$(yum --showduplicates list openstack-ironic-api | awk '/delorean
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/ironic/ironic-api/start.sh b/docker/ironic/ironic-api/extend_start.sh
index 60b3ea5a0..bbbe5c7e1 100755..100644
--- a/docker/ironic/ironic-api/start.sh
+++ b/docker/ironic/ironic-api/extend_start.sh
@@ -1,7 +1,4 @@
#!/bin/bash
-set -o errexit
-
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -9,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "ironic-dbsync upgrade" ironic
exit 0
fi
-
-exec $CMD
diff --git a/docker/ironic/ironic-conductor/Dockerfile.j2 b/docker/ironic/ironic-conductor/Dockerfile.j2
index 7fe401b4d..1a0976312 100644
--- a/docker/ironic/ironic-conductor/Dockerfile.j2
+++ b/docker/ironic/ironic-conductor/Dockerfile.j2
@@ -13,8 +13,4 @@ RUN VER_TO_GET=$(yum --showduplicates list openstack-ironic-conductor | awk '/de
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/ironic/ironic-conductor/start.sh b/docker/ironic/ironic-conductor/start.sh
deleted file mode 100755
index e6b7c5bb5..000000000
--- a/docker/ironic/ironic-conductor/start.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/ironic/ironic-discoverd/Dockerfile.j2 b/docker/ironic/ironic-discoverd/Dockerfile.j2
index 6dd9a68b3..f666eb6f0 100644
--- a/docker/ironic/ironic-discoverd/Dockerfile.j2
+++ b/docker/ironic/ironic-discoverd/Dockerfile.j2
@@ -13,8 +13,4 @@ RUN pip install ironic-discoverd
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/ironic/ironic-discoverd/start.sh b/docker/ironic/ironic-discoverd/start.sh
deleted file mode 100755
index e6b7c5bb5..000000000
--- a/docker/ironic/ironic-discoverd/start.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/ironic/ironic-pxe/Dockerfile.j2 b/docker/ironic/ironic-pxe/Dockerfile.j2
index 59e80e6df..cf0604052 100644
--- a/docker/ironic/ironic-pxe/Dockerfile.j2
+++ b/docker/ironic/ironic-pxe/Dockerfile.j2
@@ -23,8 +23,5 @@ RUN apt-get install --no-install-recommends \
{% endif %}
COPY tftp-map-file /tftpboot/map-file
-COPY start.sh /
-
-CMD ["/start.sh"]
{{ include_footer }}
diff --git a/docker/ironic/ironic-pxe/start.sh b/docker/ironic/ironic-pxe/start.sh
deleted file mode 100755
index e6b7c5bb5..000000000
--- a/docker/ironic/ironic-pxe/start.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/keepalived/Dockerfile.j2 b/docker/keepalived/Dockerfile.j2
index 9fbc7c49a..717439a6c 100644
--- a/docker/keepalived/Dockerfile.j2
+++ b/docker/keepalived/Dockerfile.j2
@@ -18,8 +18,9 @@ RUN apt-get install -y --no-install-recommends \
{% endif %}
-COPY start.sh check_alive.sh /
+COPY check_alive.sh /
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start /check_alive.sh
{{ include_footer }}
diff --git a/docker/keepalived/check_alive.sh b/docker/keepalived/check_alive.sh
index 8c2684f10..8c2684f10 100755..100644
--- a/docker/keepalived/check_alive.sh
+++ b/docker/keepalived/check_alive.sh
diff --git a/docker/keepalived/start.sh b/docker/keepalived/extend_start.sh
index 1d96c3bfa..e1fe5d9d8 100755..100644
--- a/docker/keepalived/start.sh
+++ b/docker/keepalived/extend_start.sh
@@ -1,8 +1,4 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
modprobe ip_vs
@@ -10,5 +6,3 @@ modprobe ip_vs
if [ -f /run/keepalived.pid ]; then
rm /run/keepalived.pid
fi
-
-exec $CMD
diff --git a/docker/keystone/Dockerfile.j2 b/docker/keystone/Dockerfile.j2
index 115f537a2..bbea133d4 100644
--- a/docker/keystone/Dockerfile.j2
+++ b/docker/keystone/Dockerfile.j2
@@ -50,8 +50,7 @@ RUN ln -s keystone-source/* keystone \
RUN chown -R keystone: /var/www/cgi-bin/keystone \
&& chmod 755 /var/www/cgi-bin/keystone/*
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/keystone/start.sh b/docker/keystone/extend_start.sh
index 45c6391fc..9bd9d5370 100755..100644
--- a/docker/keystone/start.sh
+++ b/docker/keystone/extend_start.sh
@@ -1,8 +1,4 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions
-source /opt/kolla/kolla-common.sh
if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
"${KOLLA_BASE_DISTRO}" == "debian" ]]; then
@@ -32,5 +28,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
fi
ARGS="-DFOREGROUND"
-echo "Running command: ${CMD} ${ARGS}"
-exec $CMD $ARGS
diff --git a/docker/logging/rsyslog/Dockerfile.j2 b/docker/logging/rsyslog/Dockerfile.j2
index 60b81b5ba..db58b799a 100755..100644
--- a/docker/logging/rsyslog/Dockerfile.j2
+++ b/docker/logging/rsyslog/Dockerfile.j2
@@ -3,15 +3,14 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum -y install \
- rsyslog \
+RUN yum -y install rsyslog \
&& yum clean all
+
{% elif base_distro in ['ubuntu', 'debian'] %}
-RUN apt-get install -y --no-install-recommends \
- rsyslog \
+
+RUN apt-get install -y --no-install-recommends rsyslog \
&& apt-get clean
-{% endif %}
-COPY start.sh /
+{% endif %}
-CMD ["/start.sh"]
+{{ include_footer }}
diff --git a/docker/logging/rsyslog/start.sh b/docker/logging/rsyslog/start.sh
deleted file mode 100755
index fea488a62..000000000
--- a/docker/logging/rsyslog/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/magnum/magnum-api/Dockerfile.j2 b/docker/magnum/magnum-api/Dockerfile.j2
index 81d44e69f..3a613ab34 100644
--- a/docker/magnum/magnum-api/Dockerfile.j2
+++ b/docker/magnum/magnum-api/Dockerfile.j2
@@ -5,15 +5,12 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install openstack-magnum-api \
- && yum clean all
+ && yum clean all
{% endif %}
{% endif %}
-COPY ./start.sh /
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/magnum/magnum-api/start.sh b/docker/magnum/magnum-api/extend_start.sh
index dc22cd1c6..fae394185 100755..100644
--- a/docker/magnum/magnum-api/start.sh
+++ b/docker/magnum/magnum-api/extend_start.sh
@@ -1,11 +1,4 @@
#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/magnum-api"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -13,5 +6,3 @@ 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-conductor/Dockerfile.j2 b/docker/magnum/magnum-conductor/Dockerfile.j2
index bfd9ca32d..4e9eaef43 100644
--- a/docker/magnum/magnum-conductor/Dockerfile.j2
+++ b/docker/magnum/magnum-conductor/Dockerfile.j2
@@ -4,9 +4,10 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum -y install openstack-magnum-conductor \
- tar \
- && yum clean all
+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
@@ -14,10 +15,4 @@ RUN cd /tmp && curl -L https://github.com/GoogleCloudPlatform/kubernetes/release
{% endif %}
{% endif %}
-COPY ./start.sh /
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
-
-
{{ include_footer }}
diff --git a/docker/magnum/magnum-conductor/start.sh b/docker/magnum/magnum-conductor/start.sh
deleted file mode 100755
index b96c6324f..000000000
--- a/docker/magnum/magnum-conductor/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/magnum-conductor"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD $ARGS
diff --git a/docker/mariadb/Dockerfile.j2 b/docker/mariadb/Dockerfile.j2
index 1cfae7798..fbc699290 100644
--- a/docker/mariadb/Dockerfile.j2
+++ b/docker/mariadb/Dockerfile.j2
@@ -28,9 +28,7 @@ RUN apt-get install -y --no-install-recommends \
{% endif %}
-COPY config-galera.sh /opt/kolla/config/
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/mariadb/config-galera.sh b/docker/mariadb/extend_start.sh
index cfdd7d9a2..6fa450675 100755..100644
--- a/docker/mariadb/config-galera.sh
+++ b/docker/mariadb/extend_start.sh
@@ -31,6 +31,12 @@ function bootstrap_db {
mysqladmin -p"${DB_ROOT_PASSWORD}" shutdown
}
-function populate_db {
+chown mysql: /var/lib/mysql
+
+# This catches all cases of the BOOTSTRAP variable being set, including empty
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then
+ ARGS="--wsrep-new-cluster"
+ touch /var/lib/mysql/cluster.exists
mysql_install_db --user=mysql
-}
+ bootstrap_db
+fi
diff --git a/docker/mariadb/start.sh b/docker/mariadb/start.sh
deleted file mode 100755
index 6d80153f0..000000000
--- a/docker/mariadb/start.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions
-source /opt/kolla/kolla-common.sh
-source /opt/kolla/config/config-galera.sh
-
-chown mysql: /var/lib/mysql
-
-# This catches all cases of the BOOTSTRAP variable being set, including empty
-if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then
- ARGS="--wsrep-new-cluster"
- touch /var/lib/mysql/cluster.exists
- populate_db
- bootstrap_db
- exec $CMD $ARGS
- exit 0
-fi
-
-exec $CMD
diff --git a/docker/memcached/Dockerfile.j2 b/docker/memcached/Dockerfile.j2
index 88baa5010..d8e023aaf 100644
--- a/docker/memcached/Dockerfile.j2
+++ b/docker/memcached/Dockerfile.j2
@@ -13,8 +13,4 @@ RUN apt-get install -y --no-install-recommends memcached \
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/memcached/start.sh b/docker/memcached/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/memcached/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/mongodb/Dockerfile.j2 b/docker/mongodb/Dockerfile.j2
index f7662ae49..818bf70d6 100644
--- a/docker/mongodb/Dockerfile.j2
+++ b/docker/mongodb/Dockerfile.j2
@@ -17,9 +17,7 @@ RUN apt-get install -y --no-install-recommends mongodb-server \
RUN mkdir -p /data/db
-VOLUME /data/db
-VOLUME /var/log/mongodb
-
-ENTRYPOINT exec /bin/mongod --dbpath /data/db --logpath /var/log/mongodb/mongo.log --noprealloc --smallfiles
+# TODO(SamYaple): updated mongodb to match the rest of Kolla
+#ENTRYPOINT exec /bin/mongod --dbpath /data/db --logpath /var/log/mongodb/mongo.log --noprealloc --smallfiles
{{ include_footer }}
diff --git a/docker/murano/murano-api/Dockerfile.j2 b/docker/murano/murano-api/Dockerfile.j2
index e6b68b1c7..ea20a1f59 100644
--- a/docker/murano/murano-api/Dockerfile.j2
+++ b/docker/murano/murano-api/Dockerfile.j2
@@ -1,8 +1,7 @@
FROM {{ namespace }}/{{ image_prefix }}murano-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/murano/murano-api/start.sh b/docker/murano/murano-api/extend_start.sh
index 05bf40eec..578cc72cb 100755..100644
--- a/docker/murano/murano-api/start.sh
+++ b/docker/murano/murano-api/extend_start.sh
@@ -1,8 +1,4 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -10,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "murano-db-manage --config-file /etc/murano/murano.conf upgrade" murano
exit 0
fi
-
-exec $CMD
diff --git a/docker/murano/murano-engine/Dockerfile.j2 b/docker/murano/murano-engine/Dockerfile.j2
index e6b68b1c7..8a1bd5db1 100644
--- a/docker/murano/murano-engine/Dockerfile.j2
+++ b/docker/murano/murano-engine/Dockerfile.j2
@@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}murano-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/murano/murano-engine/start.sh b/docker/murano/murano-engine/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/murano/murano-engine/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/neutron/neutron-agents/Dockerfile.j2 b/docker/neutron/neutron-agents/Dockerfile.j2
index 3fb1ffe30..2967222f4 100644
--- a/docker/neutron/neutron-agents/Dockerfile.j2
+++ b/docker/neutron/neutron-agents/Dockerfile.j2
@@ -31,6 +31,7 @@ COPY fwaas_driver.ini /etc/neutron/
COPY neutron-dhcp-agent/ /opt/kolla/neutron-dhcp-agent
COPY neutron-l3-agent/ /opt/kolla/neutron-l3-agent
COPY neutron-metadata-agent/ /opt/kolla/neutron-metadata-agent
+COPY config-sudoers.sh /opt/kolla/
COPY start.sh /
diff --git a/docker/neutron/neutron-base/config-sudoers.sh b/docker/neutron/neutron-agents/config-sudoers.sh
index 82cf0d624..82cf0d624 100644
--- a/docker/neutron/neutron-base/config-sudoers.sh
+++ b/docker/neutron/neutron-agents/config-sudoers.sh
diff --git a/docker/neutron/neutron-agents/start.sh b/docker/neutron/neutron-agents/start.sh
index 8b5f302cf..baf3d2a8e 100755
--- a/docker/neutron/neutron-agents/start.sh
+++ b/docker/neutron/neutron-agents/start.sh
@@ -1,7 +1,7 @@
#!/bin/bash
set -o errexit
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
+# Processing /opt/kolla/config_files/config.json
+python /opt/kolla/set_configs.py
exec /usr/bin/supervisord
diff --git a/docker/neutron/neutron-base/Dockerfile.j2 b/docker/neutron/neutron-base/Dockerfile.j2
index 8560d72d5..fe073d8cf 100644
--- a/docker/neutron/neutron-base/Dockerfile.j2
+++ b/docker/neutron/neutron-base/Dockerfile.j2
@@ -40,4 +40,5 @@ RUN ln -s neutron-base-source/* neutron \
{% endif %}
-COPY config-sudoers.sh /opt/kolla/
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
diff --git a/docker/neutron/neutron-base/extend_start.sh b/docker/neutron/neutron-base/extend_start.sh
new file mode 100644
index 000000000..07212efce
--- /dev/null
+++ b/docker/neutron/neutron-base/extend_start.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# Neutron uses rootwrap which requires a tty for sudo.
+# Since the container is running in daemon mode, a tty
+# is not present and requiretty must be commented out.
+if [ ! -f /sudo-modified ]; then
+ chmod 0640 /etc/sudoers
+ sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers
+ chmod 0440 /etc/sudoers
+ touch /sudo-modified
+fi
diff --git a/docker/neutron/neutron-base/ip_wrapper.py b/docker/neutron/neutron-base/ip_wrapper.py
index 591fca6f4..871c615ab 100755..100644
--- a/docker/neutron/neutron-base/ip_wrapper.py
+++ b/docker/neutron/neutron-base/ip_wrapper.py
@@ -19,7 +19,9 @@
# access all of the neutron network namespaces as well as all
# containers that bind mount /run/netns from the host.
-# This is required for "thin" neutron containers to function properly
+# This is required for "thin" neutron containers to function properly. However,
+# due to a missing feature/bug in Docker it is not possible to use this script
+# at this time. Once Docker updates with this feature we will usre this again.
import nsenter
import subprocess
diff --git a/docker/neutron/neutron-linuxbridge-agent/Dockerfile.j2 b/docker/neutron/neutron-linuxbridge-agent/Dockerfile.j2
index 360afc4d1..179890b46 100644
--- a/docker/neutron/neutron-linuxbridge-agent/Dockerfile.j2
+++ b/docker/neutron/neutron-linuxbridge-agent/Dockerfile.j2
@@ -15,13 +15,10 @@ RUN yum install -y \
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
# Install required packages
-RUN yum install -y ebtables && yum clean all
+RUN yum install -y ebtables \
+ && yum clean all
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/neutron/neutron-linuxbridge-agent/start.sh b/docker/neutron/neutron-linuxbridge-agent/start.sh
deleted file mode 100755
index 6c4b09679..000000000
--- a/docker/neutron/neutron-linuxbridge-agent/start.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-source /opt/kolla/config-sudoers.sh
-
-exec $CMD
diff --git a/docker/neutron/neutron-openvswitch-agent/Dockerfile.j2 b/docker/neutron/neutron-openvswitch-agent/Dockerfile.j2
index b6e797b0c..5e659f5a0 100644
--- a/docker/neutron/neutron-openvswitch-agent/Dockerfile.j2
+++ b/docker/neutron/neutron-openvswitch-agent/Dockerfile.j2
@@ -15,15 +15,10 @@ RUN yum install -y \
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
# Install required packages
-RUN yum install -y \
- openvswitch \
+RUN yum install -y openvswitch \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/neutron/neutron-openvswitch-agent/start.sh b/docker/neutron/neutron-openvswitch-agent/start.sh
deleted file mode 100755
index 6c4b09679..000000000
--- a/docker/neutron/neutron-openvswitch-agent/start.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-source /opt/kolla/config-sudoers.sh
-
-exec $CMD
diff --git a/docker/neutron/neutron-server/Dockerfile.j2 b/docker/neutron/neutron-server/Dockerfile.j2
index 12a9b2df7..5fcf47a78 100644
--- a/docker/neutron/neutron-server/Dockerfile.j2
+++ b/docker/neutron/neutron-server/Dockerfile.j2
@@ -23,8 +23,7 @@ RUN yum install -y which \
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/neutron/neutron-server/start.sh b/docker/neutron/neutron-server/extend_start.sh
index cf30a7f0a..c832d586d 100755..100644
--- a/docker/neutron/neutron-server/start.sh
+++ b/docker/neutron/neutron-server/extend_start.sh
@@ -1,8 +1,4 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -11,4 +7,12 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
-exec $CMD
+# Neutron uses rootwrap which requires a tty for sudo.
+# Since the container is running in daemon mode, a tty
+# is not present and requiretty must be commented out.
+if [ ! -f /sudo-modified ]; then
+ chmod 0640 /etc/sudoers
+ sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers
+ chmod 0440 /etc/sudoers
+ touch /sudo-modified
+fi
diff --git a/docker/nova/nova-api/Dockerfile.j2 b/docker/nova/nova-api/Dockerfile.j2
index e0d7a0db0..6ee313bd1 100644
--- a/docker/nova/nova-api/Dockerfile.j2
+++ b/docker/nova/nova-api/Dockerfile.j2
@@ -10,8 +10,7 @@ RUN yum -y install openstack-nova-api \
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/nova/nova-api/start.sh b/docker/nova/nova-api/extend_start.sh
index 6461777ca..2aaad1e8b 100755..100644
--- a/docker/nova/nova-api/start.sh
+++ b/docker/nova/nova-api/extend_start.sh
@@ -1,8 +1,4 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -10,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "nova-manage db sync" nova
exit 0
fi
-
-exec $CMD
diff --git a/docker/nova/nova-compute/Dockerfile.j2 b/docker/nova/nova-compute/Dockerfile.j2
index 428219cec..e86440ed1 100644
--- a/docker/nova/nova-compute/Dockerfile.j2
+++ b/docker/nova/nova-compute/Dockerfile.j2
@@ -4,7 +4,8 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum -y install openstack-nova-compute \
+RUN yum -y install \
+ openstack-nova-compute \
openvswitch \
sysfsutils \
&& yum clean all
@@ -31,8 +32,4 @@ RUN apt-get install -y --no-install-recommends \
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/nova/nova-compute/start.sh b/docker/nova/nova-compute/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/nova/nova-compute/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/nova/nova-conductor/Dockerfile.j2 b/docker/nova/nova-conductor/Dockerfile.j2
index 8b75626cd..09cd50322 100644
--- a/docker/nova/nova-conductor/Dockerfile.j2
+++ b/docker/nova/nova-conductor/Dockerfile.j2
@@ -4,15 +4,10 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum -y install \
- openstack-nova-conductor \
+RUN yum -y install openstack-nova-conductor \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/nova/nova-conductor/start.sh b/docker/nova/nova-conductor/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/nova/nova-conductor/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/nova/nova-consoleauth/Dockerfile.j2 b/docker/nova/nova-consoleauth/Dockerfile.j2
index b6b0e3da8..b8619778c 100644
--- a/docker/nova/nova-consoleauth/Dockerfile.j2
+++ b/docker/nova/nova-consoleauth/Dockerfile.j2
@@ -10,8 +10,4 @@ RUN yum -y install openstack-nova-console \
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/nova/nova-consoleauth/start.sh b/docker/nova/nova-consoleauth/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/nova/nova-consoleauth/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/nova/nova-libvirt/Dockerfile.j2 b/docker/nova/nova-libvirt/Dockerfile.j2
index 28be92470..514c49d49 100644
--- a/docker/nova/nova-libvirt/Dockerfile.j2
+++ b/docker/nova/nova-libvirt/Dockerfile.j2
@@ -27,8 +27,7 @@ RUN apt-get install -y --no-install-recommends \
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/nova/nova-libvirt/start.sh b/docker/nova/nova-libvirt/extend_start.sh
index df3b0e5a9..cdfe1f928 100755..100644
--- a/docker/nova/nova-libvirt/start.sh
+++ b/docker/nova/nova-libvirt/extend_start.sh
@@ -1,8 +1,4 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# TODO(SamYaple): Tweak libvirt.conf rather than change permissions.
# Fix permissions for libvirt
@@ -11,5 +7,3 @@ if [[ -c /dev/kvm ]]; then
chmod 660 /dev/kvm
chown root:kvm /dev/kvm
fi
-
-exec $CMD
diff --git a/docker/nova/nova-network/Dockerfile.j2 b/docker/nova/nova-network/Dockerfile.j2
index 2ebba6830..c95dbb69f 100644
--- a/docker/nova/nova-network/Dockerfile.j2
+++ b/docker/nova/nova-network/Dockerfile.j2
@@ -20,8 +20,4 @@ RUN yum -y install initscripts \
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/nova/nova-network/start.sh b/docker/nova/nova-network/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/nova/nova-network/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/nova/nova-novncproxy/Dockerfile.j2 b/docker/nova/nova-novncproxy/Dockerfile.j2
index 3a1e69bc8..1ad38353b 100644
--- a/docker/nova/nova-novncproxy/Dockerfile.j2
+++ b/docker/nova/nova-novncproxy/Dockerfile.j2
@@ -17,8 +17,4 @@ RUN cd /usr/share && ln -s nova-novncproxy-source/* novnc
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/nova/nova-novncproxy/start.sh b/docker/nova/nova-novncproxy/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/nova/nova-novncproxy/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/nova/nova-scheduler/Dockerfile.j2 b/docker/nova/nova-scheduler/Dockerfile.j2
index 887b0bf6b..63b8fdc5d 100644
--- a/docker/nova/nova-scheduler/Dockerfile.j2
+++ b/docker/nova/nova-scheduler/Dockerfile.j2
@@ -10,8 +10,4 @@ RUN yum -y install openstack-nova-scheduler \
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/nova/nova-scheduler/start.sh b/docker/nova/nova-scheduler/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/nova/nova-scheduler/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/openvswitch/openvswitch-db-server/Dockerfile.j2 b/docker/openvswitch/openvswitch-db-server/Dockerfile.j2
index 023bba83b..723c16071 100644
--- a/docker/openvswitch/openvswitch-db-server/Dockerfile.j2
+++ b/docker/openvswitch/openvswitch-db-server/Dockerfile.j2
@@ -1,8 +1,7 @@
FROM {{ namespace }}/{{ image_prefix }}openvswitch-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-COPY start.sh /
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/openvswitch/openvswitch-db-server/start.sh b/docker/openvswitch/openvswitch-db-server/extend_start.sh
index 60347b2dc..606cd5fc1 100755..100644
--- a/docker/openvswitch/openvswitch-db-server/start.sh
+++ b/docker/openvswitch/openvswitch-db-server/extend_start.sh
@@ -1,12 +1,6 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
mkdir -p "/run/openvswitch"
if [[ ! -e "/etc/openvswitch/conf.db" ]]; then
ovsdb-tool create "/etc/openvswitch/conf.db"
fi
-
-exec $CMD
diff --git a/docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2 b/docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2
index 8dbd6548a..bdb15a340 100644
--- a/docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2
+++ b/docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2
@@ -1,9 +1,9 @@
FROM {{ namespace }}/{{ image_prefix }}openvswitch-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-COPY start.sh /
COPY ovs_ensure_configured.sh /opt/kolla/
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start /opt/kolla/ovs_ensure_configured.sh
{{ include_footer }}
diff --git a/docker/openvswitch/openvswitch-vswitchd/extend_start.sh b/docker/openvswitch/openvswitch-vswitchd/extend_start.sh
new file mode 100644
index 000000000..e2fc55465
--- /dev/null
+++ b/docker/openvswitch/openvswitch-vswitchd/extend_start.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+modprobe openvswitch
diff --git a/docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh b/docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh
index c39d64ff7..c39d64ff7 100755..100644
--- a/docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh
+++ b/docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh
diff --git a/docker/openvswitch/openvswitch-vswitchd/start.sh b/docker/openvswitch/openvswitch-vswitchd/start.sh
deleted file mode 100755
index b72ba5a2e..000000000
--- a/docker/openvswitch/openvswitch-vswitchd/start.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-modprobe openvswitch
-
-exec $CMD
diff --git a/docker/rabbitmq/Dockerfile.j2 b/docker/rabbitmq/Dockerfile.j2
index 1d6db3e13..764dd7c92 100644
--- a/docker/rabbitmq/Dockerfile.j2
+++ b/docker/rabbitmq/Dockerfile.j2
@@ -19,9 +19,7 @@ RUN apt-get install -y --no-install-recommends rabbitmq-server \
RUN /usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management
-COPY start.sh /
-COPY config-rabbit.sh /opt/kolla/
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/rabbitmq/config-rabbit.sh b/docker/rabbitmq/config-rabbit.sh
deleted file mode 100644
index c87a2ab48..000000000
--- a/docker/rabbitmq/config-rabbit.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-function set_rabbitmq_cookie {
- echo "${RABBITMQ_CLUSTER_COOKIE}" > /var/lib/rabbitmq/.erlang.cookie
- chown -R rabbitmq: /var/lib/rabbitmq
- chmod 400 /var/lib/rabbitmq/.erlang.cookie
-}
diff --git a/docker/heat/heat-engine/start.sh b/docker/rabbitmq/extend_start.sh
index 21a783da1..e1c1007e3 100755..100644
--- a/docker/heat/heat-engine/start.sh
+++ b/docker/rabbitmq/extend_start.sh
@@ -1,14 +1,10 @@
#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# 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/bash -c "/usr/bin/heat-manage db_sync" heat
+ echo "${RABBITMQ_CLUSTER_COOKIE}" > /var/lib/rabbitmq/.erlang.cookie
+ chown -R rabbitmq: /var/lib/rabbitmq
+ chmod 400 /var/lib/rabbitmq/.erlang.cookie
exit 0
fi
-
-exec $CMD
diff --git a/docker/rabbitmq/start.sh b/docker/rabbitmq/start.sh
deleted file mode 100755
index 1a018bc89..000000000
--- a/docker/rabbitmq/start.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# loading common functions
-source /opt/kolla/kolla-common.sh
-source /opt/kolla/config-rabbit.sh
-
-# This catches all cases of the BOOTSTRAP variable being set, including empty
-if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
- set_rabbitmq_cookie
- exit 0
-fi
-
-exec $CMD
diff --git a/docker/swift/swift-account-auditor/Dockerfile.j2 b/docker/swift/swift-account-auditor/Dockerfile.j2
index a8ffc48ae..baa52aaa3 100644
--- a/docker/swift/swift-account-auditor/Dockerfile.j2
+++ b/docker/swift/swift-account-auditor/Dockerfile.j2
@@ -4,15 +4,10 @@ MAINTAINER Kolla Project (https://launchpad.net.kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
-RUN yum -y install \
- openstack-swift-account \
+RUN yum -y install openstack-swift-account \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-account-auditor/start.sh b/docker/swift/swift-account-auditor/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-account-auditor/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-account-reaper/Dockerfile.j2 b/docker/swift/swift-account-reaper/Dockerfile.j2
index a8ffc48ae..baa52aaa3 100644
--- a/docker/swift/swift-account-reaper/Dockerfile.j2
+++ b/docker/swift/swift-account-reaper/Dockerfile.j2
@@ -4,15 +4,10 @@ MAINTAINER Kolla Project (https://launchpad.net.kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
-RUN yum -y install \
- openstack-swift-account \
+RUN yum -y install openstack-swift-account \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-account-reaper/start.sh b/docker/swift/swift-account-reaper/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-account-reaper/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-account-replicator/Dockerfile.j2 b/docker/swift/swift-account-replicator/Dockerfile.j2
index a8ffc48ae..baa52aaa3 100644
--- a/docker/swift/swift-account-replicator/Dockerfile.j2
+++ b/docker/swift/swift-account-replicator/Dockerfile.j2
@@ -4,15 +4,10 @@ MAINTAINER Kolla Project (https://launchpad.net.kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
-RUN yum -y install \
- openstack-swift-account \
+RUN yum -y install openstack-swift-account \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-account-replicator/start.sh b/docker/swift/swift-account-replicator/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-account-replicator/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-account-server/Dockerfile.j2 b/docker/swift/swift-account-server/Dockerfile.j2
index dc4c56bfc..22bb86298 100644
--- a/docker/swift/swift-account-server/Dockerfile.j2
+++ b/docker/swift/swift-account-server/Dockerfile.j2
@@ -4,15 +4,10 @@ MAINTAINER Kolla Project (https://launchpad.net.kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum -y install \
- openstack-swift-account \
+RUN yum -y install openstack-swift-account \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-account-server/start.sh b/docker/swift/swift-account-server/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-account-server/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-base/config-swift.sh b/docker/swift/swift-base/config-swift.sh
index b101b4e69..b101b4e69 100755..100644
--- a/docker/swift/swift-base/config-swift.sh
+++ b/docker/swift/swift-base/config-swift.sh
diff --git a/docker/swift/swift-container-auditor/Dockerfile.j2 b/docker/swift/swift-container-auditor/Dockerfile.j2
index 7e7b6632b..2a784a23e 100644
--- a/docker/swift/swift-container-auditor/Dockerfile.j2
+++ b/docker/swift/swift-container-auditor/Dockerfile.j2
@@ -4,15 +4,10 @@ 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 \
+RUN yum -y install openstack-swift-container \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-container-auditor/start.sh b/docker/swift/swift-container-auditor/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-container-auditor/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-container-replicator/Dockerfile.j2 b/docker/swift/swift-container-replicator/Dockerfile.j2
index 7e7b6632b..2a784a23e 100644
--- a/docker/swift/swift-container-replicator/Dockerfile.j2
+++ b/docker/swift/swift-container-replicator/Dockerfile.j2
@@ -4,15 +4,10 @@ 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 \
+RUN yum -y install openstack-swift-container \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-container-replicator/start.sh b/docker/swift/swift-container-replicator/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-container-replicator/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-container-server/Dockerfile.j2 b/docker/swift/swift-container-server/Dockerfile.j2
index 47ca202f3..cc456fd25 100644
--- a/docker/swift/swift-container-server/Dockerfile.j2
+++ b/docker/swift/swift-container-server/Dockerfile.j2
@@ -4,15 +4,10 @@ MAINTAINER Kolla Project (https://launchpad.net.kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum -y install \
- openstack-swift-container \
+RUN yum -y install openstack-swift-container \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-container-server/start.sh b/docker/swift/swift-container-server/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-container-server/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-container-updater/Dockerfile.j2 b/docker/swift/swift-container-updater/Dockerfile.j2
index 7e7b6632b..2a784a23e 100644
--- a/docker/swift/swift-container-updater/Dockerfile.j2
+++ b/docker/swift/swift-container-updater/Dockerfile.j2
@@ -4,15 +4,10 @@ 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 \
+RUN yum -y install openstack-swift-container \
&& yum clean all
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-container-updater/start.sh b/docker/swift/swift-container-updater/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-container-updater/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-object-auditor/Dockerfile.j2 b/docker/swift/swift-object-auditor/Dockerfile.j2
index 247b5e078..211b3e530 100644
--- a/docker/swift/swift-object-auditor/Dockerfile.j2
+++ b/docker/swift/swift-object-auditor/Dockerfile.j2
@@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}swift-object-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net.kolla)
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-object-auditor/start.sh b/docker/swift/swift-object-auditor/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-object-auditor/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-object-base/Dockerfile.j2 b/docker/swift/swift-object-base/Dockerfile.j2
index 5479ac2e8..f89d8da88 100644
--- a/docker/swift/swift-object-base/Dockerfile.j2
+++ b/docker/swift/swift-object-base/Dockerfile.j2
@@ -4,11 +4,8 @@ MAINTAINER Kolla Project (https://launchpad.net.kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum -y install \
- openstack-swift-object \
+RUN yum -y install openstack-swift-object \
&& yum clean all
{% endif %}
{% endif %}
-
-COPY config-swift-object.sh /opt/kolla/
diff --git a/docker/swift/swift-object-base/config-swift-object.sh b/docker/swift/swift-object-base/config-swift-object.sh
deleted file mode 100644
index 0d3d58dc3..000000000
--- a/docker/swift/swift-object-base/config-swift-object.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/bash
-
-. /opt/kolla/kolla-common.sh
-
-check_required_vars \
- SWIFT_CONTAINER_SVC_RING_DEVICES \
- SWIFT_CONTAINER_SVC_RING_HOSTS \
- SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS \
- SWIFT_CONTAINER_SVC_RING_NAME \
- SWIFT_CONTAINER_SVC_RING_PART_POWER \
- SWIFT_CONTAINER_SVC_RING_REPLICAS \
- SWIFT_CONTAINER_SVC_RING_WEIGHTS \
- SWIFT_CONTAINER_SVC_RING_ZONES \
- SWIFT_DIR \
- SWIFT_OBJECT_SVC_BIND_IP \
- SWIFT_OBJECT_SVC_BIND_PORT \
- SWIFT_OBJECT_SVC_DEVICES \
- SWIFT_OBJECT_SVC_MOUNT_CHECK \
- SWIFT_OBJECT_SVC_PIPELINE \
- SWIFT_OBJECT_SVC_RING_DEVICES \
- SWIFT_OBJECT_SVC_RING_HOSTS \
- SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS \
- SWIFT_OBJECT_SVC_RING_NAME \
- SWIFT_OBJECT_SVC_RING_PART_POWER \
- SWIFT_OBJECT_SVC_RING_REPLICAS \
- SWIFT_OBJECT_SVC_RING_WEIGHTS \
- SWIFT_OBJECT_SVC_RING_ZONES \
- SWIFT_USER
-
-cfg=/etc/swift/object-server.conf
-
-crudini --set $cfg DEFAULT bind_ip "${SWIFT_OBJECT_SVC_BIND_IP}"
-crudini --set $cfg DEFAULT bind_port "${SWIFT_OBJECT_SVC_BIND_PORT}"
-crudini --set $cfg DEFAULT user "${SWIFT_USER}"
-crudini --set $cfg DEFAULT swift_dir "${SWIFT_DIR}"
-crudini --set $cfg DEFAULT devices "${SWIFT_OBJECT_SVC_DEVICES}"
-crudini --set $cfg DEFAULT mount_check "${SWIFT_OBJECT_SVC_MOUNT_CHECK}"
-
-crudini --set $cfg pipeline:main pipeline "${SWIFT_OBJECT_SVC_PIPELINE}"
-
-# NOTE(pbourke): some services require a section in the conf, even if empty
-crudini --set $cfg object-expirer
-
-# Create swift user and group if they don't exist
-id -u swift &>/dev/null || useradd --user-group swift
-
-# Ensure proper ownership of the mount point directory structure
-chown -R swift:swift /srv/node
-
-# TODO(pbourke): does this need to be on a data vol?
-mkdir -p /var/cache/swift
-chown -R swift:swift /var/cache/swift
-
-python /opt/kolla/build-swift-ring.py \
- -f ${SWIFT_OBJECT_SVC_RING_NAME} \
- -p ${SWIFT_OBJECT_SVC_RING_PART_POWER} \
- -r ${SWIFT_OBJECT_SVC_RING_REPLICAS} \
- -m ${SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS} \
- -H ${SWIFT_OBJECT_SVC_RING_HOSTS} \
- -w ${SWIFT_OBJECT_SVC_RING_WEIGHTS} \
- -d ${SWIFT_OBJECT_SVC_RING_DEVICES} \
- -z ${SWIFT_OBJECT_SVC_RING_ZONES}
-
-python /opt/kolla/build-swift-ring.py \
- -f ${SWIFT_CONTAINER_SVC_RING_NAME} \
- -p ${SWIFT_CONTAINER_SVC_RING_PART_POWER} \
- -r ${SWIFT_CONTAINER_SVC_RING_REPLICAS} \
- -m ${SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS} \
- -H ${SWIFT_CONTAINER_SVC_RING_HOSTS} \
- -w ${SWIFT_CONTAINER_SVC_RING_WEIGHTS} \
- -d ${SWIFT_CONTAINER_SVC_RING_DEVICES} \
- -z ${SWIFT_CONTAINER_SVC_RING_ZONES}
diff --git a/docker/swift/swift-object-expirer/Dockerfile.j2 b/docker/swift/swift-object-expirer/Dockerfile.j2
index 7682df365..31078bda1 100644
--- a/docker/swift/swift-object-expirer/Dockerfile.j2
+++ b/docker/swift/swift-object-expirer/Dockerfile.j2
@@ -12,8 +12,4 @@ RUN yum -y install \
{% endif %}
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-object-expirer/start.sh b/docker/swift/swift-object-expirer/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-object-expirer/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-object-replicator/Dockerfile.j2 b/docker/swift/swift-object-replicator/Dockerfile.j2
index 247b5e078..211b3e530 100644
--- a/docker/swift/swift-object-replicator/Dockerfile.j2
+++ b/docker/swift/swift-object-replicator/Dockerfile.j2
@@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}swift-object-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net.kolla)
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-object-replicator/start.sh b/docker/swift/swift-object-replicator/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-object-replicator/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-object-server/Dockerfile.j2 b/docker/swift/swift-object-server/Dockerfile.j2
index 247b5e078..211b3e530 100644
--- a/docker/swift/swift-object-server/Dockerfile.j2
+++ b/docker/swift/swift-object-server/Dockerfile.j2
@@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}swift-object-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net.kolla)
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-object-server/start.sh b/docker/swift/swift-object-server/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-object-server/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-object-updater/Dockerfile.j2 b/docker/swift/swift-object-updater/Dockerfile.j2
index 247b5e078..211b3e530 100644
--- a/docker/swift/swift-object-updater/Dockerfile.j2
+++ b/docker/swift/swift-object-updater/Dockerfile.j2
@@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}swift-object-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net.kolla)
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-object-updater/start.sh b/docker/swift/swift-object-updater/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-object-updater/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/swift/swift-proxy-server/Dockerfile.j2 b/docker/swift/swift-proxy-server/Dockerfile.j2
index 864d8dc5d..f997214e2 100644
--- a/docker/swift/swift-proxy-server/Dockerfile.j2
+++ b/docker/swift/swift-proxy-server/Dockerfile.j2
@@ -4,12 +4,13 @@ MAINTAINER Kolla Project (https://launchpad.net.kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum -y install openstack-swift-proxy && yum clean all
+RUN yum -y install openstack-swift-proxy \
+ && yum clean all
{% endif %}
{% endif %}
-COPY ./start.sh /start.sh
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/swift/swift-proxy-server/extend_start.sh b/docker/swift/swift-proxy-server/extend_start.sh
new file mode 100644
index 000000000..78afd2e99
--- /dev/null
+++ b/docker/swift/swift-proxy-server/extend_start.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+source /opt/kolla/config-swift.sh
diff --git a/docker/swift/swift-proxy-server/start.sh b/docker/swift/swift-proxy-server/start.sh
deleted file mode 100755
index 2fbfc3012..000000000
--- a/docker/swift/swift-proxy-server/start.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-source /opt/kolla/config-swift.sh
-
-exec $CMD
diff --git a/docker/swift/swift-rsyncd/Dockerfile.j2 b/docker/swift/swift-rsyncd/Dockerfile.j2
index 7fd6b3593..e307e31fd 100644
--- a/docker/swift/swift-rsyncd/Dockerfile.j2
+++ b/docker/swift/swift-rsyncd/Dockerfile.j2
@@ -1,21 +1,16 @@
FROM {{ namespace }}/{{ image_prefix }}swift-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+{% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %}
RUN yum install -y rsync \
&& yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}
-RUN apt-get install -y --no-install-recommends \
- rsync \
+RUN apt-get install -y --no-install-recommends rsync \
&& apt-get clean
{% endif %}
-COPY start.sh /
-
-CMD ["/start.sh"]
-
{{ include_footer }}
diff --git a/docker/swift/swift-rsyncd/start.sh b/docker/swift/swift-rsyncd/start.sh
deleted file mode 100755
index a083e7bac..000000000
--- a/docker/swift/swift-rsyncd/start.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
-
-exec $CMD
diff --git a/docker/zaqar/Dockerfile.j2 b/docker/zaqar/Dockerfile.j2
index e406a8c8c..9a5346c97 100644
--- a/docker/zaqar/Dockerfile.j2
+++ b/docker/zaqar/Dockerfile.j2
@@ -20,9 +20,7 @@ RUN ln -s zaqar-source/* zaqar \
{% endif %}
-COPY start.sh /
-COPY config-external.sh /opt/kolla/
-
-CMD ["/start.sh"]
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/zaqar/start.sh b/docker/zaqar/extend_start.sh
index c5f1dea7f..d71b02aab 100755..100644
--- a/docker/zaqar/start.sh
+++ b/docker/zaqar/extend_start.sh
@@ -1,11 +1,4 @@
#!/bin/bash
-set -o errexit
-
-CMD="/usr/bin/zaqar-server"
-ARGS=""
-
-# Loading common functions.
-source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -13,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "zaqar-manage db_sync" cinder
exit 0
fi
-
-exec $CMD $ARGS