This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile-6.2.6
122 lines (116 loc) · 4.74 KB
/
Dockerfile-6.2.6
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
FROM debian:buster-slim AS builder
LABEL maintainer="tbd"
# define variables
ARG TIEREDMEMDB_COMMIT=c6af492
ENV REDIS_REPO="https://github.com/TieredMemDB/TieredMemDB.git" \
REDIS_COMMIT="${TIEREDMEMDB_COMMIT}" \
LD_LIBRARY_PATH="/usr/local/lib" \
PREFIX="/opt/bitnami/redis" \
HOME="/" \
OS_ARCH="amd64" \
OS_FLAVOUR="debian-10" \
OS_NAME="linux" \
BITNAMI_APP_NAME="redis-cluster" \
BITNAMI_IMAGE_VERSION="6.2.6" \
PATH="/opt/bitnami/common/bin:/opt/bitnami/redis/bin:$PATH" \
BITNAMI_REDIS_CLUSTER_REPO=https://github.com/bitnami/bitnami-docker-redis-cluster.git \
BITNAMI_REDIS_CLUSTER_TAG="6.2.6-debian-10-r196" \
BITNAMI_REDIS_CLUSTER_VERSION="6.2"
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
echo "deb http://deb.debian.org/debian buster-backports main" | tee /etc/apt/sources.list.d/buster-backports.list; \
apt-get update; \
apt-get install -y --no-install-recommends \
acl \
autoconf \
automake \
binutils \
ca-certificates \
curl \
daxctl \
g++ \
gcc \
git \
gzip \
libc6 \
libc6-dev \
libcap2-bin \
libssl1.1 \
libssl-dev \
libtool \
libdaxctl-dev \
libnuma-dev \
make \
ndctl \
numactl \
pkg-config \
procps \
tar \
tcl \
unzip \
wget \
; \
#apt-get install -y --no-install-recommends -t buster-backports libdaxctl-dev ndctl libcap2-bin; \
rm -rf /var/lib/apt/lists/*; \
\
# redis download and choose specific commit
mkdir -p /opt/redis; \
git clone ${REDIS_REPO} /opt/redis; \
cd /opt/redis && git reset --hard ${REDIS_COMMIT}; \
cd /opt/redis && git submodule init && git submodule update; \
\
# disable Redis protected mode [1] as it is unnecessary in context of Docker
# (ports are not automatically exposed when running inside Docker, but rather explicitly by specifying -p / -P)
# [1]: https://github.com/antirez/redis/commit/edd4d555df57dc84265fdfb4ef59a4678832f6da
grep -E '^ *createBoolConfig[(]"protected-mode",.*, *1 *,.*[)],$' /opt/redis/src/config.c; \
sed -ri 's!^( *createBoolConfig[(]"protected-mode",.*, *)1( *,.*[)],)$!\10\2!' /opt/redis/src/config.c; \
grep -E '^ *createBoolConfig[(]"protected-mode",.*, *0 *,.*[)],$' /opt/redis/src/config.c; \
# for future reference, we modify this directly in the source instead of just supplying a default configuration flag because apparently "if you specify any argument to redis-server, [it assumes] you are going to specify everything"
# see also https://github.com/docker-library/redis/issues/4#issuecomment-50780840
# (more exactly, this makes sure the default behavior of "save on SIGTERM" stays functional by default)
cd /opt/redis && make MALLOC=memkind; \
cd /opt/redis && make install; \
\
# TODO https://github.com/antirez/redis/pull/3494 (deduplicate "redis-server" copies)
serverMd5="$(md5sum ${PREFIX}/bin/redis-server | cut -d' ' -f1)"; export serverMd5; \
find ${PREFIX}/bin/redis* -maxdepth 0 \
-type f -not -name redis-server \
-exec sh -eux -c ' \
md5="$(md5sum "$1" | cut -d" " -f1)"; \
test "$md5" = "$serverMd5"; \
' -- '{}' ';' \
-exec ln -svfT 'redis-server' '{}' ';' \
; \
mkdir -p /opt/bitnami/redis/etc; \
cp /opt/redis/redis.conf /opt/bitnami/redis/etc/redis-default.conf; \
\
rm -r /opt/redis; \
\
apt-mark auto '.*' > /dev/null; \
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
find $PREFIX -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -r apt-mark manual \
; \
apt list;
RUN mkdir /tmp/bitnami-docker-redis-cluster; \
cd /tmp/bitnami-docker-redis-cluster; \
git init; \
git remote add -f origin ${BITNAMI_REDIS_CLUSTER_REPO}; \
git config core.sparseCheckout true; \
echo "${BITNAMI_REDIS_CLUSTER_VERSION}/debian-10/prebuildfs" >> .git/info/sparse-checkout; \
echo "${BITNAMI_REDIS_CLUSTER_VERSION}/debian-10/rootfs" >> .git/info/sparse-checkout; \
git pull origin ${BITNAMI_REDIS_CLUSTER_TAG} --depth 1; \
cp -r ${BITNAMI_REDIS_CLUSTER_VERSION}/debian-10/prebuildfs/* /; \
cp -r ${BITNAMI_REDIS_CLUSTER_VERSION}/debian-10/rootfs/* /; \
rm -rf /opt/bitnami-docker-redis-cluster;
RUN chmod g+rwX /opt/bitnami
RUN /opt/bitnami/scripts/redis-cluster/postunpack.sh
EXPOSE 6379
ENTRYPOINT [ "/opt/bitnami/scripts/redis-cluster/entrypoint.sh" ]
CMD [ "/opt/bitnami/scripts/redis-cluster/run.sh" ]