-
Notifications
You must be signed in to change notification settings - Fork 122
/
Dockerfile
38 lines (30 loc) · 1.28 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM ubuntu:16.04
MAINTAINER Arash Pourhabibi Zarandi <[email protected]>
# 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"]