Containerize Memcached

Basic implementation without authentication

Closes-Bug: MCP-379
Change-Id: Ib1bed22a47a54d52bd133ff06de51f543c4153bb
This commit is contained in:
Aleksandr Mogylchenko 2016-05-10 12:28:40 +03:00
parent be191389c8
commit 51a4ac2e8f
4 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,18 @@
FROM {{ namespace }}/openstack-base:{{ tag }}
MAINTAINER {{ maintainer }}
ENV DEBIAN_FRONTEND "noninteractive"
RUN apt-get update \
&& apt-get install -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" memcached \
&& rm -rf /var/lib/apt/lists/*
#USER memcache
ADD run.sh /run.sh
RUN chmod +x /run.sh
ENTRYPOINT ["/run.sh"]
CMD [""]
EXPOSE 11211

3
docker/memcached/run.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
memcached -u memcache -l 0.0.0.0 $@

View File

@ -0,0 +1,16 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: memcached-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: memcached
spec:
containers:
- name: memcached
image: nextgen/memcached:v1
ports:
- containerPort: 11211

9
tox.ini Normal file
View File

@ -0,0 +1,9 @@
[tox]
minversion = 1.6
skipsdist = True
envlist = bashate
[testenv:bashate]
deps = bashate>=0.2
whitelist_externals = bash
commands = bash -c "find {toxinidir} -type f -name '*.sh' -not -path '*/.tox/*' -print0 | xargs -0 bashate -v"