Permalink
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (30 sloc) 1.28 KB
FROM ubuntu:16.04
MAINTAINER Arash Pourhabibi Zarandi <arash.pourhabibi@epfl.ch>
# This is based on the official memcached Dockerfile
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r memcache && useradd -r -g memcache memcache
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
libevent-2.0-5 \
&& rm -rf /var/lib/apt/lists/*
ENV MEMCACHED_VERSION 1.4.24
ENV MEMCACHED_SHA1 32a798a37ef782da10a09d74aa1e5be91f2861db
RUN buildDeps='curl gcc libc6-dev libevent-dev make perl' \
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& curl -SL "http://memcached.org/files/memcached-$MEMCACHED_VERSION.tar.gz" -o memcached.tar.gz \
&& echo "$MEMCACHED_SHA1 memcached.tar.gz" | sha1sum -c - \
&& mkdir -p /usr/src/memcached \
&& tar -xzf memcached.tar.gz -C /usr/src/memcached --strip-components=1 \
&& rm memcached.tar.gz \
&& cd /usr/src/memcached \
&& ./configure \
&& make \
&& make install \
&& cd / && rm -rf /usr/src/memcached \
&& apt-get purge -y --auto-remove $buildDeps
ENTRYPOINT ["memcached"]
USER memcache
EXPOSE 11211
CMD ["-t", "2", "-m", "2048", "-n", "550"]