-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_redis.sh
44 lines (40 loc) · 2.45 KB
/
build_redis.sh
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
#!/bin/bash
apt install qemu-user-static binfmt-support
cat > Dockerfile <<\EOF
# FROM debian:buster-20210111
FROM debian:bookworm
RUN apt update && apt install -y git build-essential autoconf libtool libssl-dev pkg-config cmake
# RUN git clone --branch 6.0.16 https://github.com/redis/redis/ /root/Redis
RUN git clone --branch 7.2.4 https://github.com/redis/redis/ /root/Redis
WORKDIR /root/Redis
RUN make -j4
# RUN git clone --recursive --branch v1.6.9 https://github.com/RedisTimeSeries/RedisTimeSeries.git /root/RedisTimeSeries
RUN git clone --recursive --branch v1.10.11 https://github.com/RedisTimeSeries/RedisTimeSeries.git /root/RedisTimeSeries
WORKDIR /root/RedisTimeSeries
RUN ./deps/readies/bin/getpy3
RUN make -j4 build
EOF
#----------------
# compile for x64
#docker image rm debian:buster-20210111 # Work around Docker not supporting several platform-specific versions of the same image.
docker image rm debian:bookworm # Work around Docker not supporting several platform-specific versions of the same image.
docker build --platform linux/amd64 -t build-redis-x64 .
docker run --rm --entrypoint cat build-redis-x64 /root/Redis/src/redis-server > redis-server-x64
docker run --rm --entrypoint cat build-redis-x64 /root/RedisTimeSeries/bin/linux-x64-release/redistimeseries.so > redistimeseries-x64.so
chmod +x redis-server-x64 redistimeseries-x64.so
#------------------------
# compile for arm (32bit)
#docker image rm debian:buster-20210111 # Work around Docker not supporting several platform-specific versions of the same image.
docker image rm debian:bookworm
docker build --platform linux/arm/v7 -t build-redis-arm .
docker run --rm --entrypoint cat build-redis-arm /root/Redis/src/redis-server > redis-server-arm
docker run --rm --entrypoint cat build-redis-arm /root/RedisTimeSeries/bin/linux-arm32v7-release/redistimeseries.so > redistimeseries-arm.so
chmod +x redis-server-arm redistimeseries-arm.so
#------------------------
# compile for aarch64 (arm 64bit)
#docker image rm debian:buster-20210111 # Work around Docker not supporting several platform-specific versions of the same image.
docker image rm debian:bookworm
docker build --platform linux/arm64 -t build-redis-arm64 .
docker run --rm --entrypoint cat build-redis-arm64 /root/Redis/src/redis-server > redis-server-aarch64
docker run --rm --entrypoint cat build-redis-arm64 /root/RedisTimeSeries/bin/linux-arm64v8-release/redistimeseries.so > redistimeseries-arm64.so
chmod +x redis-server-arm redistimeseries-arm64.so