forked from OT-CONTAINER-KIT/redis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.sentinel
60 lines (37 loc) · 1.61 KB
/
Dockerfile.sentinel
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
FROM alpine:3.15 as builder
ARG TARGETARCH
LABEL version=1.0 \
arch=$TARGETARCH \
description="A production grade performance tuned redis docker image created by Opstree Solutions"
ARG REDIS_DOWNLOAD_URL="http://download.redis.io/"
ARG REDIS_SENTINEL_VERSION="stable"
RUN apk add --no-cache su-exec tzdata make curl build-base linux-headers bash openssl-dev
WORKDIR /tmp
RUN curl -fL -Lo redis-${REDIS_SENTINEL_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-${REDIS_SENTINEL_VERSION}.tar.gz && \
tar xvzf redis-${REDIS_SENTINEL_VERSION}.tar.gz && \
make -C redis-${REDIS_SENTINEL_VERSION} && \
make -C redis-${REDIS_SENTINEL_VERSION} install BUILD_TLS=yes
FROM alpine:3.15
ARG TARGETARCH
ENV SENTINEL_PORT=26379
LABEL version=1.0 \
arch=$TARGETARCH \
description="A production grade performance tuned redis docker image created by Opstree Solutions"
COPY --from=builder /usr/local/bin/redis-cli /usr/local/bin/redis-cli
COPY --from=builder /usr/local/bin/redis-sentinel /usr/local/bin/redis-sentinel
RUN addgroup -S -g 1000 redis && adduser -S -G redis -u 1000 redis && \
apk add --no-cache bash
COPY sentinel.conf /etc/redis/sentinel.conf
COPY entrypoint-sentinel.sh /usr/bin/entrypoint-sentinel.sh
COPY healthcheck-Sentinel.sh /usr/bin/healthcheck.sh
RUN chown -R 1000:0 /etc/redis && \
chmod -R g+rw /etc/redis && \
mkdir /sentinel-data && \
chown -R 1000:0 /sentinel-data && \
chmod -R g+rw /sentinel-data && \
chmod -R g+rw /var/run
VOLUME ["/sentinel-data"]
WORKDIR /sentinel-data
EXPOSE ${SENTINEL_PORT}
USER 1000
ENTRYPOINT ["/usr/bin/entrypoint-sentinel.sh"]