diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index 518491ccb71678d9af57d4e2b42e0dacf4e929c9..c17cfa25eb11f0c7a08f1756bb0b7ad5ab775a64 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 0cbb048211b75401da9db0cf8621127bd3ec69ce..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..7d89f636c66dcd338007c83c6256141f97fa7ee5 --- /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 f720ee15d4ed537779c6b3bb46142c1260ad9f34..387c63ae1c9350341f540b2c2f5d288477e063ea 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 d98577e08ba5a3b2f013f1bd4e7e5b3ed855bb0d..0000000000000000000000000000000000000000 --- 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 7470a9026dd079ae59c0eb5a610323706c078ad3..0519d6f0f5fa1a904bc42a87ece5559be6124d8b 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 6ba3cc37de09226561c63b6c9943250ad7ab1ccc..afe612ae69381c16f4d813e8e79a0c1f44a52e25 --- 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 3b2e9a2c07c7f3ccd995b3a32a3ac6d114edd9ff..01447126eab4c87fb066d3be58507e7150109f3a 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 e074febc90bf34015c368306355ef6b9a2f3d111..0000000000000000000000000000000000000000 --- 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 c5cf80d45211e6e410466c286b78f93d43bc8b3e..21509cb944ef6b9045efc77c5432d9e4ca928358 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 585e4d7f5646df5fd73f06a8abb2f767ac316e2b..0000000000000000000000000000000000000000 --- 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 dd6bc62af1d4d2bf4ffb7543c39625f993d5e58f..d2f75134d7d5f002aea18bb256e0415981f81dad 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 f17a32709a1011be1c3adb5e67667bbfeb23b5bd..0000000000000000000000000000000000000000 --- 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 571166443109cf45ec8a26529f1a9f5353ca6aa9..503e7ee7dee8c9fe0016f5a6ab2ba8afec0f34f9 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 a3421acaff107bd5854c9dee8c449db5b2eed630..0000000000000000000000000000000000000000 --- 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 57d31e81982bd3d0700118fc0393a17d3d577a94..bfcb8a1c630efd4d80eb3c0f627d6cad73e6297f 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 29b2bd700ffb513d03cf70a99de2da374b6c84d6..dce6749b3111eec52825457889ab2297717a370e --- 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 ac453ce8812b5b7b0ec9970d5e2f565d8c886833..260f98698f85ab729a02d793d44fe1929e28708e 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 4b26c426b575fbefa83ff8eccd5ea3e5ee3387d5..a63b97b3c470806e095ee612109740ee2f9fb0a4 --- 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 4c481a45f49379a6b47da93ad05c98513b67e14b..59d20cd80f22d45c3ca66292dc4ba9713c5ce24b 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 553158a826164097e7b347031d962480f4818a73..9cf68ae868bb930d806f513726e9fef5b2b81460 --- 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 14794b0531803e0369f1e6b913245e86bfa4373d..6d266f46b0484e992729215ee4ae8534a12169df 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 14794b0531803e0369f1e6b913245e86bfa4373d..6d266f46b0484e992729215ee4ae8534a12169df 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 4eda4b98191b1e8eeec528edf4e6622eb2cefdb2..5047124beec1d2b55cf7f28a132d73c270bf39ab 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 f0b8ea6cff35d9af521226feeb3c2a909c753d16..4f7e2563400294a8b6dfaaf5243a69c16e6f8fd4 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 816715fa90d73826c64eddc56f7694ec645393ec..8fda9197b3c11780ee814bb9481df1046fee0919 --- 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 f163c7b9873a458675feee8e9a5bb1dac8a043cd..843209214f520f348e4b1907ebd9dcca637a3029 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 bd3f8c40145807d04dea7e7d0f103fff99594077..0000000000000000000000000000000000000000 --- 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 01ddbbfd0b756d3b4f6fde5330f1622fad2117ea..7ff03997504b926995a6a290393cb106aa681928 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 760f7eacd2d875c51acb3bd5d3ced1968607a592..0000000000000000000000000000000000000000 --- 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 fdb2d0c1d5586c902141f704e9fa3fc41eb10f57..6c2125f30d6679bb2a1a5a351da793f1d72cb4f5 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 026e8e6c3b67db2dcc01a0f76b4f260800eb78b6..0000000000000000000000000000000000000000 --- 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 1d8df60ade4bdae2ad383eb243d95b0ed2210871..ad4b428d5c35fdaf539c7a74140412cc85441c7b 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 a648b9b373ab60f0063658314a28968e4dcb32a5..0000000000000000000000000000000000000000 --- 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 bc4fa45c90e9315bc5582e19ed5db566b485b596..6c4a3ea407fec478337b2ec189ec623ae5731a29 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 94c70470c5f13c8aa19b5fa34dfef184f7783769..0000000000000000000000000000000000000000 --- 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 c0bdc14e86c66b96c475ec1adc7da0f02d5034d9..2e1aec4cd9434abb90d60b2b4b2fb8c5b226799d 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 f4463c6faf45e28f59f1225235a1bc1ee7a7cb89..eebee43e493063df58cac7ac6852d26966e1c6f6 --- 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 c0bdc14e86c66b96c475ec1adc7da0f02d5034d9..54710da06f8d9dfdf792bcf73f3ed70abb505a2d 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 b9479c1d74b46fd107ecdd90865696eaf15c6db0..00c0797260f97836da90b4660ffe5d2f683d549a 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 bb91fb831fd04ca2fd59a0324cdb27fe9fe39d45..8ca5d738817985a0db2f4fd6e377d95b93146aa0 --- 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 b9fd0a52edbf8fd5cc642a0ba681f6d993e9aa5a..f569e165bb846ddcffa3fb0fce37314946f79d22 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 6070a785ad93155677223160fdc127e32d745811..0000000000000000000000000000000000000000 --- 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 fe02ce804e22fbc619346b2b7d5ad2bb9b2d5ada..e7a4abdddf4c34d5b550dd82083273064156138b 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 3bdd4018abd393eba06d4280db6915e88228b567..cf50a5c9fc16dac6199f8fc89cb2ea01284b5799 --- 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 7b4cb7d68ca5dab7a29bf7f27854101cf814c02e..1146ee326c1eca4aa41382bb1c488b9eb5a38914 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 19eb8977751ba625f4c06127bf8810d26e37ff26..e425e4ebcee5fd47c1ef4fa1f71f83d3b507dad4 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 b451c604c747ee771908bc6491565d5af59690aa..17bd742e34f3b7a570b6b5e6958477eb7fa5d696 --- 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 3759788d1b534e738c11a5791d6e86cf5ea1be25..1a0b9b1dc970237923a623528b8ae0b914d4a488 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 427dd596506419593df7a5b709cec0a48a70c3fe..cc8c5876e03c5126b136ba0401b90b0f6e57a894 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 784ff5e87fc9b927a01d53ebd74041f3e85e62c2..7a0bf9b55db3b5dc0474a1e4e66461cb23bc6531 --- 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 016b3560bd7012c9cb6275b15a8c2485c7a5a740..6b726a41985fec974866072a7caf267f48f4846b 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 60b3ea5a08fbfc42ebbd692a9ca5eca5a0642a4d..bbbe5c7e1fd954c42ebd082a0a9d3336b7c25569 --- 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 7fe401b4d1a220a8fe96b41fc0ee9031a26cdf45..1a09763122ea3efef8285136de6e3a94a4b240c4 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 e6b7c5bb5f2dae39aca22284b0c5caa012859f08..0000000000000000000000000000000000000000 --- 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 6dd9a68b358420979f77bc60710cf3bb6d300247..f666eb6f09a7b44811c9b39bb4b94d1058388fcf 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 e6b7c5bb5f2dae39aca22284b0c5caa012859f08..0000000000000000000000000000000000000000 --- 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 59e80e6df1d51a454f1cf5679a665a4afc30dcc7..cf06040525bce379d3212efbf958c680bf1a34af 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 e6b7c5bb5f2dae39aca22284b0c5caa012859f08..0000000000000000000000000000000000000000 --- 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 9fbc7c49acf7603e99aa8b977b370e965b588395..717439a6c53fb06785673575e07b237f3e33f39a 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 1d96c3bfa55c24ac9aaf7e5c73d90959fd1de27f..e1fe5d9d8cb1e6249006bf3606e10390511ef2c0 --- 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 115f537a263c57b0b0ecf1759b69b7d6602e9fc3..bbea133d47b5a743a8f00d1468bf967bf91adaa5 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 45c6391fc72085eb475a6971ac406ed43c89dce8..9bd9d537080838782933cd40237a016ac985e942 --- 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 60b81b5ba8e5aa405b81c413e4b60e3151725680..db58b799af4a9f86d6a38a03ad28ffa9ed6f4efd --- a/docker/logging/rsyslog/Dockerfile.j2 +++ b/docker/logging/rsyslog/Dockerfile.j2 @@ -3,15 +3,14 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla) {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} -RUN yum -y install \ - rsyslog \ +RUN yum -y install rsyslog \ && yum clean all + {% elif base_distro in ['ubuntu', 'debian'] %} -RUN apt-get install -y --no-install-recommends \ - rsyslog \ + +RUN apt-get install -y --no-install-recommends rsyslog \ && apt-get clean -{% endif %} -COPY start.sh / +{% endif %} -CMD ["/start.sh"] +{{ include_footer }} diff --git a/docker/logging/rsyslog/start.sh b/docker/logging/rsyslog/start.sh deleted file mode 100755 index fea488a622d20c1dc2bb2d1c18ada732cecd2de3..0000000000000000000000000000000000000000 --- 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 81d44e69f4c490aca041605f834d9198b57e52d3..3a613ab34c5b93896d9d9ae7d783141c6839d1ff 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 dc22cd1c6fcd6dae53110211d78ac9b762eb5e78..fae394185188e2504f62454a4dcb995fd8bbbfa6 --- 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 bfd9ca32deb3318f2621654d25e6012eb71025be..4e9eaef4377533c0beb133b78c71f4f861ee3daf 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 b96c6324fc37be27ed702487675245913f38b989..0000000000000000000000000000000000000000 --- 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 1cfae7798cf2c9cb04d6b39fffdf999a525a1d5a..fbc699290ef20be556138b4b9e869211cb90db7b 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 cfdd7d9a2e70eb215a7f108ac1653893881f9fe0..6fa45067587f780db560d7185688285de23dc17a --- 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 6d80153f052986a687c94b4525e70cdc3583551f..0000000000000000000000000000000000000000 --- 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 88baa50105b1df4d5022cbe92436b1809f410ca9..d8e023aaf65266565beb32818bff1e6e15c25087 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 f7662ae495ace591857bc4944e5dbc22a94bcaaf..818bf70d68a30b2281feed4480ca54d03daee86b 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 e6b68b1c76815ff03193345e110e7bd397b01575..ea20a1f5931ba97ba606ae245215a9599d3aeb65 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 05bf40eecc9b1dad7d583abf297f6d9311e6fc61..578cc72cbe9961a5178ae32ba5ddf59a3feba62c --- 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 e6b68b1c76815ff03193345e110e7bd397b01575..8a1bd5db170b0e6519482401ad60ef076430e511 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 3fb1ffe30d59c8b032f080e4fca7874c3fcbfdbf..2967222f4dea9b4611d9364ec8518943900ac5d7 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 8b5f302cfbfb6b494a136a67f33269e6c4f0d85f..baf3d2a8e734f25d618bdccb148d57097ee966b7 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 8560d72d5ee8f24ec0e4da66d1e51772fa192c24..fe073d8cfb1068b8f6e1e7ed30f2ad1567929b8a 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 0000000000000000000000000000000000000000..07212efcef5c7e1a8cbe18da30d2f3f3fcced91a --- /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 591fca6f4b91298f7cb5fba78c6d586177d3d824..871c615aba2e4ad7ce194ef2bfe1342af6b3789b --- 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 360afc4d18b98651e876d0f1aa8002ab446d295a..179890b46ca64f7e99718bf28a4b0e1e4062801f 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 6c4b096794d746f6983352686293d363639234ac..0000000000000000000000000000000000000000 --- 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 b6e797b0c5e6521e9fcdc6b1a5601127a24228ec..5e659f5a0dc27166688f6f86ebe9e7b711f13078 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 6c4b096794d746f6983352686293d363639234ac..0000000000000000000000000000000000000000 --- 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 12a9b2df700e3d0dc0f610f92c9dff2e75272048..5fcf47a7835a7055f5d22b9ef273e6b755db2bc3 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 cf30a7f0a82a4bba657b9d0ac8aac21108a6c3d8..c832d586d458cdcae0ea01846fbd0e8c802e76dd --- 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 e0d7a0db03836cffa8f8fc12236f298683390c14..6ee313bd185a71f37a7dfc5cc51be251298feb5e 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 6461777caec12405460047a8b300340ebde6bd76..2aaad1e8b407d45e531b7d080f6b0e02387d688a --- 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 428219cecd5baba8ef977988ee471473e8407cd6..e86440ed150aaa80d57b28d32febd957cdc0fe68 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 8b75626cd7b1d2641b8aac55698fcf20fcd529ef..09cd503220f821540070fde2fb915bb5199f728a 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 b6b0e3da85d3a2ea0200be4f2d0c53281e39a7a3..b8619778c0e23cb6b9b7f423e7fae779f0d10e35 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 28be924709182f8fcf4618add1c00027c8674f42..514c49d49c2bf3cba0e061bebbca6016c3c7d223 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 df3b0e5a974afc4f9bde6050efcdaaad5dfd70b4..cdfe1f928ae6353477639e872f7e87eb276fb594 --- 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 2ebba6830fbff40287901bc1b9e54ea362436302..c95dbb69f5c99979afe50a5e3de4948ec5cb3112 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 3a1e69bc8c9c4d923791bff1a24beb39cee85f4c..1ad38353beb7ef12cf1e80ee450ed8932d371930 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 887b0bf6b6b488907a6eba99d35718febdf3e738..63b8fdc5dc4b6b0d70253560b40914e833ca3654 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 023bba83b2414787ad3ec6782b290400d6962f56..723c160719f64b472a3bdf09e70b197d6d4cf85c 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 60347b2dca13325b37d54f19e0ade5d695238a6d..606cd5fc164240d5827d07f960ab57fc33409949 --- 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 8dbd6548af355b4cfb17a7a9d0e45a6b3a20bb81..bdb15a3401bbbc1bbcfe9bfc955eaa2fb07047d2 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 0000000000000000000000000000000000000000..e2fc5546503b4d949f5379e3beb520b240e55630 --- /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 b72ba5a2e543e0317774a344aad9f3172384a992..0000000000000000000000000000000000000000 --- 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 1d6db3e13f75b5c932357619bbbd52bcf1770ad1..764dd7c926870a128d95e965ac988207a4dbd40f 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 c87a2ab48b25cd5479fc54bedbca797a87b62231..0000000000000000000000000000000000000000 --- 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 21a783da1309c6ac90f8ef5de3024e91df689d9f..e1c1007e33c872ff55027d3d80e564de5c849a62 --- 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 1a018bc89e007dc190b09240c5301cece0254845..0000000000000000000000000000000000000000 --- 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 a8ffc48aef74d38e265569ea1aff1b7ff466b3d1..baa52aaa30079ef842ac8de18d340abfc0813611 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 a8ffc48aef74d38e265569ea1aff1b7ff466b3d1..baa52aaa30079ef842ac8de18d340abfc0813611 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 a8ffc48aef74d38e265569ea1aff1b7ff466b3d1..baa52aaa30079ef842ac8de18d340abfc0813611 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 dc4c56bfc1029c30e0cfc1d242a88f441b82e4c9..22bb86298cbd7d20266fa237da65237de1949d18 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 7e7b6632be364563169edd52667b7e1613edcb25..2a784a23e558d44a003e3c55fab9ff861a6aceb4 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 7e7b6632be364563169edd52667b7e1613edcb25..2a784a23e558d44a003e3c55fab9ff861a6aceb4 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 47ca202f384ddf426b5fb33e1b1e3b85cb6b2202..cc456fd25aa65ed53ad25ef88dd1238e40e69649 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 7e7b6632be364563169edd52667b7e1613edcb25..2a784a23e558d44a003e3c55fab9ff861a6aceb4 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 247b5e078862c4aacbf4f6b66eee38b5a179be57..211b3e53050ec63ff0b70664f3b0a8626ceedaca 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 5479ac2e86c2b51c070b1d600fdfa843cf1c4c36..f89d8da88a782a84d08e527edfc209bc7cb07a59 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 0d3d58dc395c4f4b1ce42f229ac5a3a9d2dc8b4a..0000000000000000000000000000000000000000 --- 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 7682df365e5ec8d06e1821ac65f486b4633c843b..31078bda1a2c9d0667c1f01c7c7e0d72d5335e81 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 247b5e078862c4aacbf4f6b66eee38b5a179be57..211b3e53050ec63ff0b70664f3b0a8626ceedaca 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 247b5e078862c4aacbf4f6b66eee38b5a179be57..211b3e53050ec63ff0b70664f3b0a8626ceedaca 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 247b5e078862c4aacbf4f6b66eee38b5a179be57..211b3e53050ec63ff0b70664f3b0a8626ceedaca 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 864d8dc5d2a08c41e6d76726ad65b75cae1b9566..f997214e2bcfe2b49f242354065a874101047b40 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 0000000000000000000000000000000000000000..78afd2e9979b28386f44d41f7e2a140779c88554 --- /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 2fbfc301239b21108f334cf15ac4724ff916e671..0000000000000000000000000000000000000000 --- 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 7fd6b3593264d24cb82bbe506ea7362b47a5a442..e307e31fd6fab6d46a0acc370d82bf1e5f41537a 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 a083e7baccc1e69267bfd9a779b600d2a86d5d22..0000000000000000000000000000000000000000 --- 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 e406a8c8c4396cbd3b8e4fb62f8c84aa2c30924b..9a5346c9761e612dff28cd844b98d43c3839a26d 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 c5f1dea7ff42374a9b6b4944b2bbcbe492f650c2..d71b02aab63d04c4493460ba7cf2b35ba1022f38 --- 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