diff options
| author | Paul Bourke <paul.bourke@oracle.com> | 2015-06-17 11:14:59 +0000 |
|---|---|---|
| committer | Paul Bourke <paul.bourke@oracle.com> | 2015-06-19 17:12:05 +0000 |
| commit | 897337cdd61f1702aa7e68da0466804bf0d21a86 (patch) | |
| tree | d8489ef0f286ff69f10ebe0b42eca6cf8b1cc123 /docker/centos/binary/swift | |
| parent | c2b05b576f45ddf432571f817be45e6bcb188f75 (diff) | |
| download | kolla-897337cdd61f1702aa7e68da0466804bf0d21a86.tar.gz kolla-897337cdd61f1702aa7e68da0466804bf0d21a86.zip | |
Symlink all non Dockerfile resources in images
The only files in the docker image directories that differ majorly between
distros are the Dockerfiles (e.g. different package manager mechanisms,
different repo sources, etc).
The supporting files such as the start.sh/check.sh and config files should
largely stay the same between base images.
This change moves these files up into a "common" directory, and symlinks them
in the same way that the build script is managed. This means when adding a new
base distro only new Dockerfiles need to be created. Also, if a distro does
happen to require a vastly different start.sh script for example, one can
choose to simply not symlink to the common and instead drop in a custom one.
Implements: blueprint refactor-base-image-layout
Change-Id: Ic4db69d31ff54a1fb95af4853a2e5ae490064284
Diffstat (limited to 'docker/centos/binary/swift')
| l---------[-rw-r--r--] | docker/centos/binary/swift/swift-account/start.sh | 35 | ||||
| l---------[-rw-r--r--] | docker/centos/binary/swift/swift-container/start.sh | 35 | ||||
| l---------[-rw-r--r--] | docker/centos/binary/swift/swift-object/start.sh | 35 | ||||
| l---------[-rw-r--r--] | docker/centos/binary/swift/swift-proxy-server/start.sh | 6 |
4 files changed, 4 insertions, 107 deletions
diff --git a/docker/centos/binary/swift/swift-account/start.sh b/docker/centos/binary/swift/swift-account/start.sh index bf86830f9..f9e76aa5b 100644..120000 --- a/docker/centos/binary/swift/swift-account/start.sh +++ b/docker/centos/binary/swift/swift-account/start.sh @@ -1,34 +1 @@ -#!/bin/bash - -: ${SWIFT_DB_USER:=swift} -: ${SWIFT_DB_NAME:=swift} -: ${KEYSTONE_AUTH_PROTOCOL:=http} -: ${SWIFT_KEYSTONE_USER:=swift} -: ${ADMIN_TENANT_NAME:=admin} - -check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ - SWIFT_ADMIN_PASSWORD -fail_unless_db -fail_unless_os_service_running keystone - -if ! [ "$SWIFT_DB_PASSWORD" ]; then - SWIFT_DB_PASSWORD=$(openssl rand -hex 15) - export SWIFT_DB_PASSWORD -fi - -sh /opt/swift/config-swift.sh account-server - -mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF -CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME}; -GRANT ALL PRIVILEGES ON swift* TO -'${SWIFT_DB_USER}'@'%' IDENTIFIED BY '${SWIFT_DB_PASSWORD}' -EOF - -export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" -export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0" - -/bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD} -/bin/keystone role-create --name ${SWIFT_KEYSTONE_USER} -/bin/keystone user-role-add --user ${SWIFT_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME} - -exec /usr/bin/swift-engine +../../../../common/swift/swift-account/start.sh
\ No newline at end of file diff --git a/docker/centos/binary/swift/swift-container/start.sh b/docker/centos/binary/swift/swift-container/start.sh index 42d4ccf35..dc3c88490 100644..120000 --- a/docker/centos/binary/swift/swift-container/start.sh +++ b/docker/centos/binary/swift/swift-container/start.sh @@ -1,34 +1 @@ -#!/bin/bash - -: ${SWIFT_DB_USER:=swift} -: ${SWIFT_DB_NAME:=swift} -: ${KEYSTONE_AUTH_PROTOCOL:=http} -: ${SWIFT_KEYSTONE_USER:=swift} -: ${ADMIN_TENANT_NAME:=admin} - -check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ - SWIFT_ADMIN_PASSWORD -fail_unless_db -fail_unless_os_service_running keystone - -if ! [ "$SWIFT_DB_PASSWORD" ]; then - SWIFT_DB_PASSWORD=$(openssl rand -hex 15) - export SWIFT_DB_PASSWORD -fi - -sh /opt/swift/config-swift.sh container - -mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF -CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME}; -GRANT ALL PRIVILEGES ON swift* TO -'${SWIFT_DB_USER}'@'%' IDENTIFIED BY '${SWIFT_DB_PASSWORD}' -EOF - -export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" -export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0" - -/bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD} -/bin/keystone role-create --name ${SWIFT_KEYSTONE_USER} -/bin/keystone user-role-add --user ${SWIFT_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME} - -exec /usr/bin/swift-container-server +../../../../common/swift/swift-container/start.sh
\ No newline at end of file diff --git a/docker/centos/binary/swift/swift-object/start.sh b/docker/centos/binary/swift/swift-object/start.sh index 7ed97536e..690be2540 100644..120000 --- a/docker/centos/binary/swift/swift-object/start.sh +++ b/docker/centos/binary/swift/swift-object/start.sh @@ -1,34 +1 @@ -#!/bin/bash - -: ${SWIFT_DB_USER:=swift} -: ${SWIFT_DB_NAME:=swift} -: ${KEYSTONE_AUTH_PROTOCOL:=http} -: ${SWIFT_KEYSTONE_USER:=swift} -: ${ADMIN_TENANT_NAME:=admin} - -check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ - SWIFT_ADMIN_PASSWORD -fail_unless_db -fail_unless_os_service_running keystone - -if ! [ "$SWIFT_DB_PASSWORD" ]; then - SWIFT_DB_PASSWORD=$(openssl rand -hex 15) - export SWIFT_DB_PASSWORD -fi - -sh /opt/swift/config-swift.sh engine - -mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF -CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME}; -GRANT ALL PRIVILEGES ON swift* TO -'${SWIFT_DB_USER}'@'%' IDENTIFIED BY '${SWIFT_DB_PASSWORD}' -EOF - -export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" -export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0" - -/bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD} -/bin/keystone role-create --name ${SWIFT_KEYSTONE_USER} -/bin/keystone user-role-add --user ${SWIFT_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME} - -exec /usr/bin/swift-object-server +../../../../common/swift/swift-object/start.sh
\ No newline at end of file diff --git a/docker/centos/binary/swift/swift-proxy-server/start.sh b/docker/centos/binary/swift/swift-proxy-server/start.sh index 3f387d187..6a5581a46 100644..120000 --- a/docker/centos/binary/swift/swift-proxy-server/start.sh +++ b/docker/centos/binary/swift/swift-proxy-server/start.sh @@ -1,5 +1 @@ -#!/bin/bash - -sh /opt/swift/config-swift.sh proxy - -exec /usr/bin/swift-proxy-server +../../../../common/swift/swift-proxy-server/start.sh
\ No newline at end of file |
