From cb4e875ae1e1ec2e6ddf8a6b37f42283697fd50c Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Wed, 30 Sep 2015 11:23:39 +0000 Subject: [PATCH] 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 --- docker/base/Dockerfile.j2 | 8 ++- docker/base/kolla-common.sh | 5 -- docker/base/start.sh | 13 ++++ .../ceilometer/ceilometer-alarm/Dockerfile.j2 | 5 -- docker/ceilometer/ceilometer-alarm/start.sh | 10 --- .../ceilometer/ceilometer-api/Dockerfile.j2 | 9 +-- .../{start.sh => extend_start.sh} | 9 --- .../ceilometer-central/Dockerfile.j2 | 7 +- docker/ceilometer/ceilometer-central/start.sh | 10 --- .../ceilometer-collector/Dockerfile.j2 | 7 +- .../ceilometer/ceilometer-collector/start.sh | 10 --- .../ceilometer-compute/Dockerfile.j2 | 14 ++-- docker/ceilometer/ceilometer-compute/start.sh | 10 --- .../ceilometer-notification/Dockerfile.j2 | 5 -- .../ceilometer-notification/start.sh | 10 --- docker/ceph/ceph-mon/Dockerfile.j2 | 4 +- .../ceph-mon/{start.sh => extend_start.sh} | 6 -- docker/ceph/ceph-mon/fetch_ceph_keys.py | 0 docker/ceph/ceph-osd/Dockerfile.j2 | 5 +- .../ceph-osd/{start.sh => extend_start.sh} | 6 -- docker/cinder/cinder-api/Dockerfile.j2 | 5 +- .../cinder-api/{start.sh => extend_start.sh} | 5 -- docker/cinder/cinder-backup/Dockerfile.j2 | 4 -- docker/cinder/cinder-backup/start.sh | 7 -- docker/cinder/cinder-scheduler/Dockerfile.j2 | 4 -- docker/cinder/cinder-scheduler/start.sh | 7 -- docker/cinder/cinder-volume/Dockerfile.j2 | 11 ++- docker/cinder/cinder-volume/start.sh | 7 -- docker/designate/designate-api/Dockerfile.j2 | 6 +- .../{start.sh => extend_start.sh} | 9 --- .../designate-backend-bind9/Dockerfile.j2 | 5 -- .../designate-backend-bind9/start.sh | 10 --- .../designate/designate-central/Dockerfile.j2 | 8 +-- docker/designate/designate-central/start.sh | 10 --- docker/designate/designate-mdns/Dockerfile.j2 | 5 -- docker/designate/designate-mdns/start.sh | 10 --- .../designate-poolmanager/Dockerfile.j2 | 9 +-- .../designate/designate-poolmanager/start.sh | 10 --- docker/designate/designate-sink/Dockerfile.j2 | 9 +-- docker/designate/designate-sink/start.sh | 10 --- docker/glance/glance-api/Dockerfile.j2 | 5 +- .../glance-api/{start.sh => extend_start.sh} | 6 -- docker/glance/glance-registry/Dockerfile.j2 | 4 -- docker/glance/glance-registry/start.sh | 7 -- docker/gnocchi/gnocchi-api/Dockerfile.j2 | 6 +- .../gnocchi-api/{start.sh => extend_start.sh} | 10 --- docker/gnocchi/gnocchi-statsd/Dockerfile.j2 | 5 -- docker/gnocchi/gnocchi-statsd/start.sh | 11 --- docker/haproxy/Dockerfile.j2 | 4 +- docker/haproxy/ensure_latest_config.sh | 0 docker/haproxy/{start.sh => extend_start.sh} | 9 ++- docker/heat/heat-api-cfn/Dockerfile.j2 | 4 -- docker/heat/heat-api-cfn/start.sh | 7 -- docker/heat/heat-api/Dockerfile.j2 | 5 +- .../heat-api/{start.sh => extend_start.sh} | 6 -- docker/heat/heat-engine/Dockerfile.j2 | 4 -- docker/horizon/Dockerfile.j2 | 5 +- docker/horizon/{start.sh => extend_start.sh} | 6 -- docker/ironic/ironic-api/Dockerfile.j2 | 5 +- .../ironic-api/{start.sh => extend_start.sh} | 5 -- docker/ironic/ironic-conductor/Dockerfile.j2 | 4 -- docker/ironic/ironic-conductor/start.sh | 6 -- docker/ironic/ironic-discoverd/Dockerfile.j2 | 4 -- docker/ironic/ironic-discoverd/start.sh | 6 -- docker/ironic/ironic-pxe/Dockerfile.j2 | 3 - docker/ironic/ironic-pxe/start.sh | 6 -- docker/keepalived/Dockerfile.j2 | 5 +- docker/keepalived/check_alive.sh | 0 .../keepalived/{start.sh => extend_start.sh} | 6 -- docker/keystone/Dockerfile.j2 | 5 +- docker/keystone/{start.sh => extend_start.sh} | 6 -- docker/logging/rsyslog/Dockerfile.j2 | 13 ++-- docker/logging/rsyslog/start.sh | 7 -- docker/magnum/magnum-api/Dockerfile.j2 | 9 +-- .../magnum-api/{start.sh => extend_start.sh} | 9 --- docker/magnum/magnum-conductor/Dockerfile.j2 | 13 ++-- docker/magnum/magnum-conductor/start.sh | 10 --- docker/mariadb/Dockerfile.j2 | 6 +- .../{config-galera.sh => extend_start.sh} | 10 ++- docker/mariadb/start.sh | 20 ------ docker/memcached/Dockerfile.j2 | 4 -- docker/memcached/start.sh | 7 -- docker/mongodb/Dockerfile.j2 | 6 +- docker/murano/murano-api/Dockerfile.j2 | 5 +- .../murano-api/{start.sh => extend_start.sh} | 6 -- docker/murano/murano-engine/Dockerfile.j2 | 4 -- docker/murano/murano-engine/start.sh | 7 -- docker/neutron/neutron-agents/Dockerfile.j2 | 1 + .../config-sudoers.sh | 0 docker/neutron/neutron-agents/start.sh | 4 +- docker/neutron/neutron-base/Dockerfile.j2 | 3 +- docker/neutron/neutron-base/extend_start.sh | 11 +++ docker/neutron/neutron-base/ip_wrapper.py | 4 +- .../neutron-linuxbridge-agent/Dockerfile.j2 | 7 +- .../neutron-linuxbridge-agent/start.sh | 8 --- .../neutron-openvswitch-agent/Dockerfile.j2 | 7 +- .../neutron-openvswitch-agent/start.sh | 8 --- docker/neutron/neutron-server/Dockerfile.j2 | 5 +- .../{start.sh => extend_start.sh} | 14 ++-- docker/nova/nova-api/Dockerfile.j2 | 5 +- .../nova-api/{start.sh => extend_start.sh} | 6 -- docker/nova/nova-compute/Dockerfile.j2 | 7 +- docker/nova/nova-compute/start.sh | 7 -- docker/nova/nova-conductor/Dockerfile.j2 | 7 +- docker/nova/nova-conductor/start.sh | 7 -- docker/nova/nova-consoleauth/Dockerfile.j2 | 4 -- docker/nova/nova-consoleauth/start.sh | 7 -- docker/nova/nova-libvirt/Dockerfile.j2 | 5 +- .../{start.sh => extend_start.sh} | 6 -- docker/nova/nova-network/Dockerfile.j2 | 4 -- docker/nova/nova-network/start.sh | 7 -- docker/nova/nova-novncproxy/Dockerfile.j2 | 4 -- docker/nova/nova-novncproxy/start.sh | 7 -- docker/nova/nova-scheduler/Dockerfile.j2 | 4 -- docker/nova/nova-scheduler/start.sh | 7 -- .../openvswitch-db-server/Dockerfile.j2 | 5 +- .../{start.sh => extend_start.sh} | 6 -- .../openvswitch-vswitchd/Dockerfile.j2 | 4 +- .../openvswitch-vswitchd/extend_start.sh | 3 + .../ovs_ensure_configured.sh | 0 .../openvswitch/openvswitch-vswitchd/start.sh | 9 --- docker/rabbitmq/Dockerfile.j2 | 6 +- docker/rabbitmq/config-rabbit.sh | 7 -- .../start.sh => rabbitmq/extend_start.sh} | 10 +-- docker/rabbitmq/start.sh | 14 ---- .../swift/swift-account-auditor/Dockerfile.j2 | 7 +- docker/swift/swift-account-auditor/start.sh | 7 -- .../swift/swift-account-reaper/Dockerfile.j2 | 7 +- docker/swift/swift-account-reaper/start.sh | 7 -- .../swift-account-replicator/Dockerfile.j2 | 7 +- .../swift/swift-account-replicator/start.sh | 7 -- .../swift/swift-account-server/Dockerfile.j2 | 7 +- docker/swift/swift-account-server/start.sh | 7 -- docker/swift/swift-base/config-swift.sh | 0 .../swift-container-auditor/Dockerfile.j2 | 7 +- docker/swift/swift-container-auditor/start.sh | 7 -- .../swift-container-replicator/Dockerfile.j2 | 7 +- .../swift/swift-container-replicator/start.sh | 7 -- .../swift-container-server/Dockerfile.j2 | 7 +- docker/swift/swift-container-server/start.sh | 7 -- .../swift-container-updater/Dockerfile.j2 | 7 +- docker/swift/swift-container-updater/start.sh | 7 -- .../swift/swift-object-auditor/Dockerfile.j2 | 4 -- docker/swift/swift-object-auditor/start.sh | 7 -- docker/swift/swift-object-base/Dockerfile.j2 | 5 +- .../swift-object-base/config-swift-object.sh | 72 ------------------- .../swift/swift-object-expirer/Dockerfile.j2 | 4 -- docker/swift/swift-object-expirer/start.sh | 7 -- .../swift-object-replicator/Dockerfile.j2 | 4 -- docker/swift/swift-object-replicator/start.sh | 7 -- .../swift/swift-object-server/Dockerfile.j2 | 4 -- docker/swift/swift-object-server/start.sh | 7 -- .../swift/swift-object-updater/Dockerfile.j2 | 4 -- docker/swift/swift-object-updater/start.sh | 7 -- docker/swift/swift-proxy-server/Dockerfile.j2 | 7 +- .../swift/swift-proxy-server/extend_start.sh | 3 + docker/swift/swift-proxy-server/start.sh | 8 --- docker/swift/swift-rsyncd/Dockerfile.j2 | 9 +-- docker/swift/swift-rsyncd/start.sh | 7 -- docker/zaqar/Dockerfile.j2 | 6 +- docker/zaqar/{start.sh => extend_start.sh} | 9 --- 161 files changed, 167 insertions(+), 961 deletions(-) delete mode 100644 docker/base/kolla-common.sh create mode 100644 docker/base/start.sh delete mode 100755 docker/ceilometer/ceilometer-alarm/start.sh rename docker/ceilometer/ceilometer-api/{start.sh => extend_start.sh} (66%) mode change 100755 => 100644 delete mode 100755 docker/ceilometer/ceilometer-central/start.sh delete mode 100755 docker/ceilometer/ceilometer-collector/start.sh delete mode 100755 docker/ceilometer/ceilometer-compute/start.sh delete mode 100755 docker/ceilometer/ceilometer-notification/start.sh rename docker/ceph/ceph-mon/{start.sh => extend_start.sh} (94%) mode change 100755 => 100644 mode change 100755 => 100644 docker/ceph/ceph-mon/fetch_ceph_keys.py rename docker/ceph/ceph-osd/{start.sh => extend_start.sh} (95%) mode change 100755 => 100644 rename docker/cinder/cinder-api/{start.sh => extend_start.sh} (78%) mode change 100755 => 100644 delete mode 100755 docker/cinder/cinder-backup/start.sh delete mode 100755 docker/cinder/cinder-scheduler/start.sh delete mode 100755 docker/cinder/cinder-volume/start.sh rename docker/designate/designate-api/{start.sh => extend_start.sh} (66%) mode change 100755 => 100644 delete mode 100755 docker/designate/designate-backend-bind9/start.sh delete mode 100755 docker/designate/designate-central/start.sh delete mode 100755 docker/designate/designate-mdns/start.sh delete mode 100755 docker/designate/designate-poolmanager/start.sh delete mode 100755 docker/designate/designate-sink/start.sh rename docker/glance/glance-api/{start.sh => extend_start.sh} (74%) mode change 100755 => 100644 delete mode 100755 docker/glance/glance-registry/start.sh rename docker/gnocchi/gnocchi-api/{start.sh => extend_start.sh} (66%) mode change 100755 => 100644 delete mode 100755 docker/gnocchi/gnocchi-statsd/start.sh mode change 100755 => 100644 docker/haproxy/ensure_latest_config.sh rename docker/haproxy/{start.sh => extend_start.sh} (75%) mode change 100755 => 100644 delete mode 100755 docker/heat/heat-api-cfn/start.sh rename docker/heat/heat-api/{start.sh => extend_start.sh} (84%) mode change 100755 => 100644 rename docker/horizon/{start.sh => extend_start.sh} (67%) mode change 100755 => 100644 rename docker/ironic/ironic-api/{start.sh => extend_start.sh} (81%) mode change 100755 => 100644 delete mode 100755 docker/ironic/ironic-conductor/start.sh delete mode 100755 docker/ironic/ironic-discoverd/start.sh delete mode 100755 docker/ironic/ironic-pxe/start.sh mode change 100755 => 100644 docker/keepalived/check_alive.sh rename docker/keepalived/{start.sh => extend_start.sh} (58%) mode change 100755 => 100644 rename docker/keystone/{start.sh => extend_start.sh} (89%) mode change 100755 => 100644 mode change 100755 => 100644 docker/logging/rsyslog/Dockerfile.j2 delete mode 100755 docker/logging/rsyslog/start.sh rename docker/magnum/magnum-api/{start.sh => extend_start.sh} (66%) mode change 100755 => 100644 delete mode 100755 docker/magnum/magnum-conductor/start.sh rename docker/mariadb/{config-galera.sh => extend_start.sh} (79%) mode change 100755 => 100644 delete mode 100755 docker/mariadb/start.sh delete mode 100755 docker/memcached/start.sh rename docker/murano/murano-api/{start.sh => extend_start.sh} (77%) mode change 100755 => 100644 delete mode 100755 docker/murano/murano-engine/start.sh rename docker/neutron/{neutron-base => neutron-agents}/config-sudoers.sh (100%) create mode 100644 docker/neutron/neutron-base/extend_start.sh mode change 100755 => 100644 docker/neutron/neutron-base/ip_wrapper.py delete mode 100755 docker/neutron/neutron-linuxbridge-agent/start.sh delete mode 100755 docker/neutron/neutron-openvswitch-agent/start.sh rename docker/neutron/neutron-server/{start.sh => extend_start.sh} (51%) mode change 100755 => 100644 rename docker/nova/nova-api/{start.sh => extend_start.sh} (74%) mode change 100755 => 100644 delete mode 100755 docker/nova/nova-compute/start.sh delete mode 100755 docker/nova/nova-conductor/start.sh delete mode 100755 docker/nova/nova-consoleauth/start.sh rename docker/nova/nova-libvirt/{start.sh => extend_start.sh} (73%) mode change 100755 => 100644 delete mode 100755 docker/nova/nova-network/start.sh delete mode 100755 docker/nova/nova-novncproxy/start.sh delete mode 100755 docker/nova/nova-scheduler/start.sh rename docker/openvswitch/openvswitch-db-server/{start.sh => extend_start.sh} (61%) mode change 100755 => 100644 create mode 100644 docker/openvswitch/openvswitch-vswitchd/extend_start.sh mode change 100755 => 100644 docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh delete mode 100755 docker/openvswitch/openvswitch-vswitchd/start.sh delete mode 100644 docker/rabbitmq/config-rabbit.sh rename docker/{heat/heat-engine/start.sh => rabbitmq/extend_start.sh} (56%) mode change 100755 => 100644 delete mode 100755 docker/rabbitmq/start.sh delete mode 100755 docker/swift/swift-account-auditor/start.sh delete mode 100755 docker/swift/swift-account-reaper/start.sh delete mode 100755 docker/swift/swift-account-replicator/start.sh delete mode 100755 docker/swift/swift-account-server/start.sh mode change 100755 => 100644 docker/swift/swift-base/config-swift.sh delete mode 100755 docker/swift/swift-container-auditor/start.sh delete mode 100755 docker/swift/swift-container-replicator/start.sh delete mode 100755 docker/swift/swift-container-server/start.sh delete mode 100755 docker/swift/swift-container-updater/start.sh delete mode 100755 docker/swift/swift-object-auditor/start.sh delete mode 100644 docker/swift/swift-object-base/config-swift-object.sh delete mode 100755 docker/swift/swift-object-expirer/start.sh delete mode 100755 docker/swift/swift-object-replicator/start.sh delete mode 100755 docker/swift/swift-object-server/start.sh delete mode 100755 docker/swift/swift-object-updater/start.sh create mode 100644 docker/swift/swift-proxy-server/extend_start.sh delete mode 100755 docker/swift/swift-proxy-server/start.sh delete mode 100755 docker/swift/swift-rsyncd/start.sh rename docker/zaqar/{start.sh => extend_start.sh} (66%) mode change 100755 => 100644 diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index 518491ccb7..c17cfa25eb 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 0cbb048211..0000000000 --- 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 0000000000..7d89f636c6 --- /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 f720ee15d4..387c63ae1c 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 d98577e08b..0000000000 --- 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 7470a9026d..0519d6f0f5 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 old mode 100755 new mode 100644 similarity index 66% rename from docker/ceilometer/ceilometer-api/start.sh rename to docker/ceilometer/ceilometer-api/extend_start.sh index 6ba3cc37de..afe612ae69 --- 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 3b2e9a2c07..01447126ea 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 e074febc90..0000000000 --- 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 c5cf80d452..21509cb944 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 585e4d7f56..0000000000 --- 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 dd6bc62af1..d2f75134d7 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 f17a32709a..0000000000 --- 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 5711664431..503e7ee7de 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 a3421acaff..0000000000 --- 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 57d31e8198..bfcb8a1c63 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 old mode 100755 new mode 100644 similarity index 94% rename from docker/ceph/ceph-mon/start.sh rename to docker/ceph/ceph-mon/extend_start.sh index 29b2bd700f..dce6749b31 --- 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 old mode 100755 new mode 100644 diff --git a/docker/ceph/ceph-osd/Dockerfile.j2 b/docker/ceph/ceph-osd/Dockerfile.j2 index ac453ce881..260f98698f 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 old mode 100755 new mode 100644 similarity index 95% rename from docker/ceph/ceph-osd/start.sh rename to docker/ceph/ceph-osd/extend_start.sh index 4b26c426b5..a63b97b3c4 --- 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 4c481a45f4..59d20cd80f 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 old mode 100755 new mode 100644 similarity index 78% rename from docker/cinder/cinder-api/start.sh rename to docker/cinder/cinder-api/extend_start.sh index 553158a826..9cf68ae868 --- 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 14794b0531..6d266f46b0 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 a083e7bacc..0000000000 --- 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 14794b0531..6d266f46b0 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 a083e7bacc..0000000000 --- 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 4eda4b9819..5047124bee 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 a083e7bacc..0000000000 --- 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 f0b8ea6cff..4f7e256340 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 old mode 100755 new mode 100644 similarity index 66% rename from docker/designate/designate-api/start.sh rename to docker/designate/designate-api/extend_start.sh index 816715fa90..8fda9197b3 --- 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 f163c7b987..843209214f 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 bd3f8c4014..0000000000 --- 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 01ddbbfd0b..7ff0399750 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 760f7eacd2..0000000000 --- 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 fdb2d0c1d5..6c2125f30d 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 026e8e6c3b..0000000000 --- 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 1d8df60ade..ad4b428d5c 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 a648b9b373..0000000000 --- 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 bc4fa45c90..6c4a3ea407 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 94c70470c5..0000000000 --- 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 c0bdc14e86..2e1aec4cd9 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 old mode 100755 new mode 100644 similarity index 74% rename from docker/glance/glance-api/start.sh rename to docker/glance/glance-api/extend_start.sh index f4463c6faf..eebee43e49 --- 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 c0bdc14e86..54710da06f 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 a083e7bacc..0000000000 --- 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 b9479c1d74..00c0797260 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 old mode 100755 new mode 100644 similarity index 66% rename from docker/gnocchi/gnocchi-api/start.sh rename to docker/gnocchi/gnocchi-api/extend_start.sh index bb91fb831f..8ca5d73881 --- 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 b9fd0a52ed..f569e165bb 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 6070a785ad..0000000000 --- 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 fe02ce804e..e7a4abdddf 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 old mode 100755 new mode 100644 diff --git a/docker/haproxy/start.sh b/docker/haproxy/extend_start.sh old mode 100755 new mode 100644 similarity index 75% rename from docker/haproxy/start.sh rename to docker/haproxy/extend_start.sh index 3bdd4018ab..cf50a5c9fc --- 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 7b4cb7d68c..1146ee326c 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 a083e7bacc..0000000000 --- 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 19eb897775..e425e4ebce 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 old mode 100755 new mode 100644 similarity index 84% rename from docker/heat/heat-api/start.sh rename to docker/heat/heat-api/extend_start.sh index b451c604c7..17bd742e34 --- 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 3759788d1b..1a0b9b1dc9 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 427dd59650..cc8c5876e0 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 old mode 100755 new mode 100644 similarity index 67% rename from docker/horizon/start.sh rename to docker/horizon/extend_start.sh index 784ff5e87f..7a0bf9b55d --- 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 016b3560bd..6b726a4198 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 old mode 100755 new mode 100644 similarity index 81% rename from docker/ironic/ironic-api/start.sh rename to docker/ironic/ironic-api/extend_start.sh index 60b3ea5a08..bbbe5c7e1f --- 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 7fe401b4d1..1a09763122 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 e6b7c5bb5f..0000000000 --- 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 6dd9a68b35..f666eb6f09 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 e6b7c5bb5f..0000000000 --- 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 59e80e6df1..cf06040525 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 e6b7c5bb5f..0000000000 --- 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 9fbc7c49ac..717439a6c5 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 old mode 100755 new mode 100644 diff --git a/docker/keepalived/start.sh b/docker/keepalived/extend_start.sh old mode 100755 new mode 100644 similarity index 58% rename from docker/keepalived/start.sh rename to docker/keepalived/extend_start.sh index 1d96c3bfa5..e1fe5d9d8c --- 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 115f537a26..bbea133d47 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 old mode 100755 new mode 100644 similarity index 89% rename from docker/keystone/start.sh rename to docker/keystone/extend_start.sh index 45c6391fc7..9bd9d53708 --- 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 old mode 100755 new mode 100644 index 60b81b5ba8..db58b799af --- 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 / - -CMD ["/start.sh"] +{{ include_footer }} diff --git a/docker/logging/rsyslog/start.sh b/docker/logging/rsyslog/start.sh deleted file mode 100755 index fea488a622..0000000000 --- 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 81d44e69f4..3a613ab34c 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 old mode 100755 new mode 100644 similarity index 66% rename from docker/magnum/magnum-api/start.sh rename to docker/magnum/magnum-api/extend_start.sh index dc22cd1c6f..fae3941851 --- 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 bfd9ca32de..4e9eaef437 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 b96c6324fc..0000000000 --- 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 1cfae7798c..fbc699290e 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 old mode 100755 new mode 100644 similarity index 79% rename from docker/mariadb/config-galera.sh rename to docker/mariadb/extend_start.sh index cfdd7d9a2e..6fa4506758 --- 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 6d80153f05..0000000000 --- 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 88baa50105..d8e023aaf6 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 a083e7bacc..0000000000 --- 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 f7662ae495..818bf70d68 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 e6b68b1c76..ea20a1f593 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 old mode 100755 new mode 100644 similarity index 77% rename from docker/murano/murano-api/start.sh rename to docker/murano/murano-api/extend_start.sh index 05bf40eecc..578cc72cbe --- 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 e6b68b1c76..8a1bd5db17 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 a083e7bacc..0000000000 --- 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 3fb1ffe30d..2967222f4d 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 similarity index 100% rename from docker/neutron/neutron-base/config-sudoers.sh rename to docker/neutron/neutron-agents/config-sudoers.sh diff --git a/docker/neutron/neutron-agents/start.sh b/docker/neutron/neutron-agents/start.sh index 8b5f302cfb..baf3d2a8e7 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 8560d72d5e..fe073d8cfb 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 0000000000..07212efcef --- /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 old mode 100755 new mode 100644 index 591fca6f4b..871c615aba --- 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 360afc4d18..179890b46c 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 6c4b096794..0000000000 --- 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 b6e797b0c5..5e659f5a0d 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 6c4b096794..0000000000 --- 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 12a9b2df70..5fcf47a783 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 old mode 100755 new mode 100644 similarity index 51% rename from docker/neutron/neutron-server/start.sh rename to docker/neutron/neutron-server/extend_start.sh index cf30a7f0a8..c832d586d4 --- 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 e0d7a0db03..6ee313bd18 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 old mode 100755 new mode 100644 similarity index 74% rename from docker/nova/nova-api/start.sh rename to docker/nova/nova-api/extend_start.sh index 6461777cae..2aaad1e8b4 --- 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 428219cecd..e86440ed15 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 a083e7bacc..0000000000 --- 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 8b75626cd7..09cd503220 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 a083e7bacc..0000000000 --- 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 b6b0e3da85..b8619778c0 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 a083e7bacc..0000000000 --- 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 28be924709..514c49d49c 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 old mode 100755 new mode 100644 similarity index 73% rename from docker/nova/nova-libvirt/start.sh rename to docker/nova/nova-libvirt/extend_start.sh index df3b0e5a97..cdfe1f928a --- 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 2ebba6830f..c95dbb69f5 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 a083e7bacc..0000000000 --- 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 3a1e69bc8c..1ad38353be 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 a083e7bacc..0000000000 --- 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 887b0bf6b6..63b8fdc5dc 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 a083e7bacc..0000000000 --- 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 023bba83b2..723c160719 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 old mode 100755 new mode 100644 similarity index 61% rename from docker/openvswitch/openvswitch-db-server/start.sh rename to docker/openvswitch/openvswitch-db-server/extend_start.sh index 60347b2dca..606cd5fc16 --- 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 8dbd6548af..bdb15a3401 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 0000000000..e2fc554650 --- /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 old mode 100755 new mode 100644 diff --git a/docker/openvswitch/openvswitch-vswitchd/start.sh b/docker/openvswitch/openvswitch-vswitchd/start.sh deleted file mode 100755 index b72ba5a2e5..0000000000 --- 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 1d6db3e13f..764dd7c926 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 c87a2ab48b..0000000000 --- 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 old mode 100755 new mode 100644 similarity index 56% rename from docker/heat/heat-engine/start.sh rename to docker/rabbitmq/extend_start.sh index 21a783da13..e1c1007e33 --- 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 1a018bc89e..0000000000 --- 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 a8ffc48aef..baa52aaa30 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 a083e7bacc..0000000000 --- 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 a8ffc48aef..baa52aaa30 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 a083e7bacc..0000000000 --- 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 a8ffc48aef..baa52aaa30 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 a083e7bacc..0000000000 --- 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 dc4c56bfc1..22bb86298c 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 a083e7bacc..0000000000 --- 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 old mode 100755 new mode 100644 diff --git a/docker/swift/swift-container-auditor/Dockerfile.j2 b/docker/swift/swift-container-auditor/Dockerfile.j2 index 7e7b6632be..2a784a23e5 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 a083e7bacc..0000000000 --- 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 7e7b6632be..2a784a23e5 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 a083e7bacc..0000000000 --- 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 47ca202f38..cc456fd25a 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 a083e7bacc..0000000000 --- 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 7e7b6632be..2a784a23e5 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 a083e7bacc..0000000000 --- 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 247b5e0788..211b3e5305 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 a083e7bacc..0000000000 --- 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 5479ac2e86..f89d8da88a 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 0d3d58dc39..0000000000 --- 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 7682df365e..31078bda1a 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 a083e7bacc..0000000000 --- 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 247b5e0788..211b3e5305 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 a083e7bacc..0000000000 --- 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 247b5e0788..211b3e5305 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 a083e7bacc..0000000000 --- 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 247b5e0788..211b3e5305 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 a083e7bacc..0000000000 --- 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 864d8dc5d2..f997214e2b 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 0000000000..78afd2e997 --- /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 2fbfc30123..0000000000 --- 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 7fd6b35932..e307e31fd6 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 a083e7bacc..0000000000 --- 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 e406a8c8c4..9a5346c976 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 old mode 100755 new mode 100644 similarity index 66% rename from docker/zaqar/start.sh rename to docker/zaqar/extend_start.sh index c5f1dea7ff..d71b02aab6 --- 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