forked from RedisGears/RedisGears
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·66 lines (44 loc) · 1.66 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
# BUILD redisfab/redisgears-${OSNICK}:M.m.b-${ARCH}
ARG REDIS_VER=5.0.7
# OSNICK=bionic|stretch|buster
ARG OSNICK=buster
# OS=debian:buster-slim|debian:stretch-slim|ubuntu:bionic
ARG OS=debian:buster-slim
# ARCH=x64|arm64v8|arm32v7
ARG ARCH=x64
#----------------------------------------------------------------------------------------------
FROM redisfab/redis:${REDIS_VER}-${ARCH}-${OSNICK} AS redis
FROM ${OS} AS builder
ARG OSNICK
ARG OS
ARG ARCH
ARG REDIS_VER
RUN echo "Building for ${OSNICK} (${OS}) for ${ARCH}"
WORKDIR /build
COPY --from=redis /usr/local/ /usr/local/
ADD . /build
RUN ./deps/readies/bin/getpy2
RUN ./system-setup.py
RUN make fetch SHOW=1
RUN make all SHOW=1
ARG PACK=0
ARG TEST=0
RUN if [ "$PACK" = "1" ]; then make pack; fi
RUN if [ "$TEST" = "1" ]; then TEST= make test; fi
#----------------------------------------------------------------------------------------------
FROM redisfab/redis:${REDIS_VER}-${ARCH}-${OSNICK}
ARG OSNICK
ARG OS
ARG ARCH
ARG REDIS_VER
ARG PACK
ENV REDIS_MODULES /var/opt/redislabs/lib/modules
RUN mkdir -p $REDIS_MODULES/ /var/opt/redislabs/artifacts
COPY --from=builder /build/redisgears.so $REDIS_MODULES/
COPY --from=builder /build/artifacts/ /var/opt/redislabs/artifacts/
RUN tar --warning=no-timestamp -xzf /var/opt/redislabs/artifacts/release/redisgears-dependencies.*.tgz -C /
RUN if [ "$PACK" != "1" ]; then rm -rf /var/opt/redislabs/artifacts; fi
RUN chown -R redis:redis /var/opt/redislabs
RUN if [ ! -z $(command -v apt-get) ]; then apt-get -qq update; apt-get -q install -y git; fi
RUN if [ ! -z $(command -v yum) ]; then yum install -y git; fi
CMD ["--loadmodule", "/var/opt/redislabs/lib/modules/redisgears.so"]