forked from starkdg/Redis-ImageScout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-v2
46 lines (30 loc) · 1.13 KB
/
Dockerfile-v2
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
# BUILD starkdg/imagescout:${VERSION}-${ARCH}-${OSNICK}
ARG REDIS_VER=6.2.6-v4-x86_64
ARG OS=debian:buster-slim
ARG ARCH=x64
#---------------------------------------------------------------------
FROM redis/redis-stack:$REDIS_VER AS redis
# Build based on ${OS} (i.e. 'builder'), redis files are copies from 'redis'
FROM $OS AS builder
RUN echo "Building for $OS ($ARCH)"
WORKDIR /build
COPY --from=redis /usr/local/ /usr/local/
ADD CMakeLists.txt *.h *.cpp *.hpp /build/
RUN set -ex;\
apt-get -q update ;\
apt-get install -y --no-install-recommends ca-certificates wget;\
apt-get install -y --no-install-recommends build-essential cmake
RUN set -ex;\
cmake -DCMAKE_BUILD_TYPE=Release . ;\
make
#--------------------------------------------------------------------
FROM redis/redis-stack:$REDIS_VER
WORKDIR /data
ENV LIBDIR /usr/lib/redis/modules
ENV LIBREDIS /usr/lib/redis
RUN mkdir -p $LIBDIR
COPY --from=builder /build/imgscout.so "$LIBDIR"
COPY ./6383.conf "$LIBREDIS"
RUN chmod 644 /usr/lib/redis/6383.conf && useradd redis && chown redis /usr/lib/redis/6383.conf
EXPOSE 6383
CMD ["redis-server", "/usr/lib/redis/6383.conf"]