-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
68 lines (62 loc) · 1.95 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
68
FROM alpine:3.9
ENV GEARMAND_VERSION 1.1.18
ENV GEARMAND_SHA1 eb7f1d806635cba309c40460c3ca5f2ff76d6519
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 \
mariadb-dev \
libmemcached-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=yes \
--with-postgresql=no \
--disable-libpq \
--disable-libtokyocabinet \
--disable-libdrizzle \
--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 docker-entrypoint.sh /usr/local/bin/
RUN apk add --no-cache bash \
&& touch /etc/gearmand.conf && chown gearman:gearman /etc/gearmand.conf \
&& ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat
ENTRYPOINT ["docker-entrypoint.sh"]
USER gearman
EXPOSE 4730
CMD ["gearmand"]