From ffad0a13a0cc5fa638c960c075be034c2929ba18 Mon Sep 17 00:00:00 2001 From: James McCarthy Date: Thu, 16 Jul 2015 11:48:04 +0100 Subject: [PATCH] Add memcached image (required by Swift) Co-Authored-By: Paul Bourke Partially Implements: Blueprint swift-container Change-Id: I9d732b120c6a6354fe450cfc3f00dd2469bb9265 --- compose/memcached.yml | 7 +++++++ docker/centos/binary/memcached/Dockerfile | 10 ++++++++++ docker/centos/binary/memcached/build | 1 + docker/centos/binary/memcached/config-external.sh | 1 + docker/centos/binary/memcached/config-internal.sh | 1 + docker/centos/binary/memcached/start.sh | 1 + docker/common/memcached/config-external.sh | 10 ++++++++++ docker/common/memcached/config-internal.sh | 8 ++++++++ docker/common/memcached/start.sh | 14 ++++++++++++++ docs/minimal-environment-vars.md | 4 ++++ 10 files changed, 57 insertions(+) create mode 100644 compose/memcached.yml create mode 100644 docker/centos/binary/memcached/Dockerfile create mode 120000 docker/centos/binary/memcached/build create mode 120000 docker/centos/binary/memcached/config-external.sh create mode 120000 docker/centos/binary/memcached/config-internal.sh create mode 120000 docker/centos/binary/memcached/start.sh create mode 100755 docker/common/memcached/config-external.sh create mode 100755 docker/common/memcached/config-internal.sh create mode 100755 docker/common/memcached/start.sh diff --git a/compose/memcached.yml b/compose/memcached.yml new file mode 100644 index 0000000000..77c7904dc1 --- /dev/null +++ b/compose/memcached.yml @@ -0,0 +1,7 @@ +memcached: + image: kollaglue/centos-rdo-memcached:latest + name: memcached + restart: always + net: "host" + env_file: + - openstack.env diff --git a/docker/centos/binary/memcached/Dockerfile b/docker/centos/binary/memcached/Dockerfile new file mode 100644 index 0000000000..019eb4312e --- /dev/null +++ b/docker/centos/binary/memcached/Dockerfile @@ -0,0 +1,10 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum -y install memcached && yum clean all + +COPY start.sh / + +COPY config-internal.sh config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker/centos/binary/memcached/build b/docker/centos/binary/memcached/build new file mode 120000 index 0000000000..8d652f7ee2 --- /dev/null +++ b/docker/centos/binary/memcached/build @@ -0,0 +1 @@ +../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/memcached/config-external.sh b/docker/centos/binary/memcached/config-external.sh new file mode 120000 index 0000000000..1b684c65a4 --- /dev/null +++ b/docker/centos/binary/memcached/config-external.sh @@ -0,0 +1 @@ +../../../../docker/common/memcached/config-external.sh \ No newline at end of file diff --git a/docker/centos/binary/memcached/config-internal.sh b/docker/centos/binary/memcached/config-internal.sh new file mode 120000 index 0000000000..7ae7016a6e --- /dev/null +++ b/docker/centos/binary/memcached/config-internal.sh @@ -0,0 +1 @@ +../../../../docker/common/memcached/config-internal.sh \ No newline at end of file diff --git a/docker/centos/binary/memcached/start.sh b/docker/centos/binary/memcached/start.sh new file mode 120000 index 0000000000..93a7705bb9 --- /dev/null +++ b/docker/centos/binary/memcached/start.sh @@ -0,0 +1 @@ +../../../common/memcached/start.sh \ No newline at end of file diff --git a/docker/common/memcached/config-external.sh b/docker/common/memcached/config-external.sh new file mode 100755 index 0000000000..ab9593896e --- /dev/null +++ b/docker/common/memcached/config-external.sh @@ -0,0 +1,10 @@ +#!/bin/bash +SOURCE="/opt/kolla/memcached/memcached" +TARGET="/etc/sysconfig/memcached" +OWNER="swift" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/memcached/config-internal.sh b/docker/common/memcached/config-internal.sh new file mode 100755 index 0000000000..f27cf1a830 --- /dev/null +++ b/docker/common/memcached/config-internal.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/memcached" +ARGS="-u memcached -vv" + +exec $CMD $ARGS diff --git a/docker/common/memcached/start.sh b/docker/common/memcached/start.sh new file mode 100755 index 0000000000..5348a3b5e7 --- /dev/null +++ b/docker/common/memcached/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/memcached" +ARGS="-u memcached -vv" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Config-internal script exec out of this function, it does not return here. +set_configs + +exec $CMD $ARGS diff --git a/docs/minimal-environment-vars.md b/docs/minimal-environment-vars.md index 53c68af542..a8ff612f7c 100644 --- a/docs/minimal-environment-vars.md +++ b/docs/minimal-environment-vars.md @@ -334,6 +334,10 @@ In order for each service to function, there is a minimum set of required variab None +# Memcached + + None + # Mongodb None