-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathDockerfile.arm
executable file
·82 lines (56 loc) · 1.87 KB
/
Dockerfile.arm
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
73
74
75
76
77
78
79
80
81
82
# BUILD redisfab/redisai:${VERSION}-cpu-${ARCH}-${OSNICK}
ARG REDIS_VER=6.0.9
# OSNICK=bionic|stretch|buster
ARG OSNICK=buster
# OS=debian:buster-slim|debian:stretch-slim|ubuntu:bionic
ARG OS=debian:buster-slim
# ARCH=arm64v8|arm32v7
ARG ARCH=arm64v8
ARG PACK=0
ARG TEST=0
#----------------------------------------------------------------------------------------------
FROM redisfab/redis:${REDIS_VER}-${ARCH}-${OSNICK} AS redis
FROM redisfab/xbuild:${ARCH}-${OS} AS builder
ARG OSNICK
ARG OS
ARG ARCH
ARG REDIS_VER
RUN [ "cross-build-start" ]
RUN echo "Building for ${OSNICK} (${OS}) for ${ARCH}"
WORKDIR /build
COPY --from=redis /usr/local/ /usr/local/
COPY ./opt/ opt/
COPY ./tests/flow/test_requirements.txt tests/flow
RUN ./opt/readies/bin/getpy3
RUN ./opt/system-setup.py
ARG DEPS_ARGS=""
COPY ./get_deps.sh .
RUN if [ "$DEPS_ARGS" = "" ]; then ./get_deps.sh cpu; else env $DEPS_ARGS ./get_deps.sh cpu; fi
ARG BUILD_ARGS=""
ADD ./ /build
RUN set -e ;\
. ./opt/readies/bin/sourced ./profile.d ;\
make -C opt build $BUILD_ARGS SHOW=1
ARG PACK
ARG TEST
RUN if [ "$PACK" = "1" ]; then make -C opt pack; fi
RUN if [ "$TEST" = "1" ]; then TEST= make -C opt test $BUILD_ARGS NO_LFS=1; fi
RUN [ "cross-build-end" ]
#----------------------------------------------------------------------------------------------
FROM redisfab/redis-xbuild:${REDIS_VER}-${ARCH}-${OSNICK}
RUN [ "cross-build-start" ]
ARG OSNICK
ARG OS
ARG ARCH
ARG REDIS_VER
ARG PACK
RUN if [ ! -z $(command -v apt-get) ]; then apt-get -qq update; apt-get -q install -y libgomp1; fi
RUN if [ ! -z $(command -v yum) ]; then yum install -y libgomp; fi
ENV REDIS_MODULES /usr/lib/redis/modules
ENV LD_LIBRARY_PATH $REDIS_MODULES
RUN mkdir -p $REDIS_MODULES/
COPY --from=builder /build/install-cpu/ $REDIS_MODULES/
WORKDIR /data
EXPOSE 6379
CMD ["--loadmodule", "/usr/lib/redis/modules/redisai.so"]
RUN [ "cross-build-end" ]