forked from RedisTimeSeries/RedisTimeSeries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
72 lines (54 loc) · 1.71 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
69
70
71
72
# BUILD redisfab/redistimeseries:${VERSION}-${ARCH}-${OSNICK}
ARG REDIS_VER=6.2.5
# OSNICK=focal|bionic|xenial|bullseye|centos8|centos7
ARG OSNICK=bullseye
# OS=debian:bullseye-slim|ubuntu:bionic|centos:8
ARG OS=debian:bullseye-slim
# ARCH=x64|arm64v8|arm32v7
ARG ARCH=x64
ARG PACK=0
ARG TEST=0
#----------------------------------------------------------------------------------------------
FROM redisfab/redis:${REDIS_VER}-${ARCH}-${OSNICK} AS redis
FROM ${OS} AS builder
ARG OSNICK
ARG OS
ARG ARCH
ARG REDIS_VER
ARG PACK
ARG TEST
RUN echo "Building for ${OSNICK} (${OS}) for ${ARCH} [with Redis ${REDIS_VER}]"
WORKDIR /build
COPY --from=redis /usr/local/ /usr/local/
ADD . /build
RUN ./deps/readies/bin/getupdates
RUN ./deps/readies/bin/getpy3
RUN ./system-setup.py
RUN bash -l -c "make fetch"
RUN bash -l -c "make build"
RUN mkdir -p bin/artifacts
RUN set -e ;\
if [ "$PACK" = "1" ]; then bash -l -c "make pack"; fi
RUN set -e ;\
if [ "$TEST" = "1" ]; then \
bash -l -c "TEST= make test" ;\
cd /build/tests/flow/logs ;\
rm -f *.aof *.rdb ;\
tar -czf /build/bin/artifacts/tests-flow-logs-${ARCH}-${OSNICK}.tgz . ;\
fi
#----------------------------------------------------------------------------------------------
FROM redisfab/redis:${REDIS_VER}-${ARCH}-${OSNICK}
ARG OSNICK
ARG OS
ARG ARCH
ARG REDIS_VER
ARG PACK
ENV LIBDIR /usr/lib/redis/modules/
WORKDIR /data
RUN mkdir -p "$LIBDIR"
RUN mkdir -p /var/opt/redislabs/artifacts
RUN chown -R redis:redis /var/opt/redislabs
COPY --from=builder /build/bin/artifacts/ /var/opt/redislabs/artifacts
COPY --from=builder /build/bin/redistimeseries.so "$LIBDIR"
EXPOSE 6379
CMD ["redis-server", "--loadmodule", "/usr/lib/redis/modules/redistimeseries.so"]