Skip to content

Commit ff66379

Browse files
authored
Docker with RediSearch revisited (RedisJSON#488)
1 parent f6d450f commit ff66379

File tree

4 files changed

+76
-4
lines changed

4 files changed

+76
-4
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ workflows:
384384
<<: *not-on-integ-branch
385385
- platforms-build:
386386
context: common
387-
<<: *on-integ-and-version-tags
387+
<<: *not-on-integ-branch
388388
matrix:
389389
parameters:
390390
platform: [focal, bionic, xenial, centos8, centos7, bullseye]

build/platforms/Dockerfile

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# BUILD redisfab/rejson:${VERSION}-${ARCH}-${OSNICK}
2+
3+
ARG REDIS_VER=6.2.5
4+
5+
# OSNICK=focal|bionic|xenial|bullseye|centos8|centos7
6+
ARG OSNICK=bullseye
7+
8+
# OS=debian:bullseye-slim|ubuntu:bionic|centos:7
9+
ARG OS=debian:bullseye-slim
10+
11+
# ARCH=x64|arm64v8|arm32v7
12+
ARG ARCH=x64
13+
14+
ARG PACK=0
15+
ARG TEST=0
16+
17+
#----------------------------------------------------------------------------------------------
18+
FROM redisfab/redis:${REDIS_VER}-${ARCH}-${OSNICK} AS redis
19+
FROM ${OS} AS builder
20+
21+
ARG OSNICK
22+
ARG OS
23+
ARG ARCH
24+
ARG REDIS_VER
25+
ARG PACK
26+
ARG TEST
27+
28+
RUN echo "Building for ${OSNICK} (${OS}) for ${ARCH} [with Redis ${REDIS_VER}]"
29+
30+
WORKDIR /build
31+
COPY --from=redis /usr/local/ /usr/local/
32+
33+
ADD . /build
34+
35+
RUN ./deps/readies/bin/getupdates
36+
RUN ./deps/readies/bin/getpy3
37+
RUN ./system-setup.py
38+
39+
RUN bash -l -c make
40+
41+
RUN mkdir -p bin/artifacts
42+
RUN set -e ;\
43+
if [ "$PACK" = "1" ]; then bash -l -c "make pack"; fi
44+
RUN set -e ;\
45+
if [ "$TEST" = "1" ]; then \
46+
bash -l -c "TEST= make test" ;\
47+
cd /build/tests/pytest/logs ;\
48+
rm -f *.aof *.rdb ;\
49+
tar -czf /build/bin/artifacts/pytest-logs-${ARCH}-${OSNICK}.tgz . ;\
50+
fi
51+
52+
#----------------------------------------------------------------------------------------------
53+
FROM redisfab/redis:${REDIS_VER}-${ARCH}-${OSNICK}
54+
55+
ARG REDIS_VER
56+
ARG OSNICK
57+
ARG ARCH
58+
59+
ENV LIBDIR /usr/lib/redis/modules
60+
WORKDIR /data
61+
RUN mkdir -p "$LIBDIR"
62+
63+
RUN mkdir -p /var/opt/redislabs/artifacts
64+
RUN chown -R redis:redis /var/opt/redislabs
65+
COPY --from=builder /build/bin/artifacts/ /var/opt/redislabs/artifacts
66+
RUN true
67+
COPY --from=builder /build/target/release/rejson.so "$LIBDIR"
68+
69+
EXPOSE 6379
70+
CMD ["redis-server", \
71+
"--loadmodule", "/usr/lib/redis/modules/rejson.so"]

build/platforms/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ ROOT=../..
33
MK.pyver:=3
44
include $(ROOT)/deps/readies/mk/main
55

6+
DOCKERFILE_STEM=$(ROOT)/build/platforms/Dockerfile
7+
68
# OSNICK=bullseye|bionic|xenial|centos7|centos8
79
OSNICK ?= bullseye
810

sbin/get-redisearch

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ else
4545
fi
4646

4747
dist="$($READIES/bin/platform --dist)"
48+
nick="$($READIES/bin/platform --osnick)"
4849

4950
[[ $os == linux ]] && os=Linux
5051
[[ $arch == x64 ]] && arch=x86_64
5152

52-
if [[ -n $OSNICK ]]; then
53-
nick="$OSNICK"
54-
elif [[ $dist == ubuntu ]]; then
53+
if [[ $dist == ubuntu ]]; then
5554
if [[ $nick == focal ]]; then
5655
nick="ubuntu20.04"
5756
elif [[ $nick == bionic ]]; then

0 commit comments

Comments
 (0)