-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
67 lines (60 loc) · 1.87 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM alpine:3.8
ENV GEARMAND_VERSION 1.1.17
ENV GEARMAND_SHA1 1ff98ca77c8f05675eeb749d753a266fc433ee53
RUN addgroup -S gearman && adduser -G gearman -S -D -H -s /bin/false -g "Gearman Server" gearman
COPY patches/libhashkit-common.h.patch /libhashkit-common.h.patch
COPY patches/libtest-cmdline.cc.patch /libtest-cmdline.cc.patch
RUN set -x \
&& apk add --no-cache --virtual .build-deps \
wget \
tar \
ca-certificates \
file \
alpine-sdk \
gperf \
boost-dev \
libevent-dev \
util-linux-dev \
hiredis-dev \
libressl-dev \
&& wget -O gearmand.tar.gz "https://github.com/gearman/gearmand/releases/download/$GEARMAND_VERSION/gearmand-$GEARMAND_VERSION.tar.gz" \
&& echo "$GEARMAND_SHA1 gearmand.tar.gz" | sha1sum -c - \
&& mkdir -p /usr/src/gearmand \
&& tar -xzf gearmand.tar.gz -C /usr/src/gearmand --strip-components=1 \
&& rm gearmand.tar.gz \
&& cd /usr/src/gearmand \
&& patch -p1 < /libhashkit-common.h.patch \
&& patch -p1 < /libtest-cmdline.cc.patch \
&& ./configure \
--sysconfdir=/etc \
--localstatedir=/var \
--with-mysql=no \
--with-postgresql=no \
--disable-libpq \
--disable-libtokyocabinet \
--disable-libdrizzle \
--disable-libmemcached \
--enable-ssl \
--enable-hiredis \
--enable-jobserver=no \
&& make \
&& make install \
&& cd / && rm -rf /usr/src/gearmand \
&& rm /*.patch \
&& runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .gearmand-rundeps $runDeps \
&& apk del .build-deps \
&& /usr/local/sbin/gearmand --version
COPY gearmand.conf /etc/gearmand.conf
COPY docker-entrypoint.sh /usr/local/bin/
RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat
ENTRYPOINT ["docker-entrypoint.sh"]
USER gearman
EXPOSE 4730
CMD ["gearmand"]