Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
beagle-rcache-image
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
market
beagle-rcache-image
Commits
fac68559
Commit
fac68559
authored
Oct 10, 2022
by
iamabhishek-dubey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for Redis 7
Signed-off-by:
iamabhishek-dubey
<
abhishekbhardwaj510@gmail.com
>
parent
95ce711e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
21 deletions
+17
-21
Dockerfile
Dockerfile
+2
-8
Dockerfile.exporter
Dockerfile.exporter
+1
-1
Makefile
Makefile
+2
-2
entrypoint.sh
entrypoint.sh
+12
-10
No files found.
Dockerfile
View file @
fac68559
...
...
@@ -17,9 +17,7 @@ RUN curl -fL -Lo /tmp/redis-${REDIS_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-
tar
xvzf redis-
${
REDIS_VERSION
}
.tar.gz
&&
\
cd
redis-
${
REDIS_VERSION
}
&&
\
make
&&
\
make
install
BUILD_TLS
=
yes
&&
\
mkdir
-p
/etc/redis
&&
\
cp
-f
*
.conf /etc/redis
make
install
BUILD_TLS
=
yes
FROM
alpine:3.15
...
...
@@ -31,9 +29,8 @@ LABEL VERSION=1.0 \
COPY
--from=builder /usr/local/bin/redis-server /usr/local/bin/redis-server
COPY
--from=builder /usr/local/bin/redis-cli /usr/local/bin/redis-cli
COPY
--from=builder /etc/redis /etc/redis
RUN
addgroup
-S
-g
100
1 redis
&&
adduser
-S
-G
redis
-u
1001
redis
&&
\
RUN
addgroup
-S
-g
100
0 redis
&&
adduser
-S
-G
redis
-u
1000
redis
&&
\
apk add
--no-cache
bash
COPY
redis.conf /etc/redis/redis.conf
...
...
@@ -44,9 +41,6 @@ COPY setupMasterSlave.sh /usr/bin/setupMasterSlave.sh
COPY
healthcheck.sh /usr/bin/healthcheck.sh
RUN
mkdir
-p
/opt/redis/
&&
\
chmod
-R
g+rwX /etc/redis /opt/redis
VOLUME
["/data"]
WORKDIR
/data
...
...
Dockerfile.exporter
View file @
fac68559
...
...
@@ -2,7 +2,7 @@ FROM alpine:3.15 as builder
ARG EXPORTER_URL="https://github.com/oliver006/redis_exporter/releases/download"
ARG REDIS_EXPORTER_VERSION="1.
5.2
"
ARG REDIS_EXPORTER_VERSION="1.
44.0
"
RUN apk add --no-cache curl ca-certificates && \
curl -fL -Lo /tmp/redis_exporter-v${REDIS_EXPORTER_VERSION}.linux-amd64.tar.gz \
...
...
Makefile
View file @
fac68559
REDIS_VERSION
?=
6.2
.5
EXPORTER_VERSION
?=
1
.0
REDIS_VERSION
?=
v7.0
.5
EXPORTER_VERSION
?=
v1.44
.0
build-redis-image
:
docker build
-t
quay.io/opstree/redis:
$(REDIS_VERSION)
-f
Dockerfile .
...
...
entrypoint.sh
View file @
fac68559
...
...
@@ -2,20 +2,17 @@
set
-a
CLUSTER_DIRECTORY
=
${
CLUSTER_DIRECTORY
:-
"/opt/redis"
}
PERSISTENCE_ENABLED
=
${
PERSISTENCE_ENABLED
:-
"false"
}
DATA_DIR
=
${
DATA_DIR
:-
"/data"
}
EXTERNAL_CONFIG_FILE
=
${
EXTERNAL_CONFIG_FILE
:-
"/etc/redis/external.conf.d/redis-external.conf"
}
REDIS_MAJOR_VERSION
=
${
REDIS_MAJOR_VERSION
:-
"v7"
}
apply_permissions
()
{
chgrp
-R
0 /etc/redis
chgrp
-R
100
0 /etc/redis
chmod
-R
g
=
u /etc/redis
chgrp
-R
0 /opt
chmod
-R
g
=
u /opt
}
common_operation
()
{
mkdir
-p
"
${
CLUSTER_DIRECTORY
}
"
mkdir
-p
"
${
DATA_DIR
}
"
}
...
...
@@ -40,11 +37,12 @@ redis_mode_setup() {
echo
cluster-config-file
"
${
DATA_DIR
}
/nodes.conf"
}
>>
/etc/redis/redis.conf
if
[[
"
${
REDIS_MAJOR_VERSION
}
"
!=
"v7"
]]
;
then
if
[[
-z
"
${
POD_IP
}
"
]]
;
then
POD_IP
=
$(
hostname
-i
)
fi
sed
-i
-e
"/myself/ s/[0-9]
\{
1,3
\}\.
[0-9]
\{
1,3
\}\.
[0-9]
\{
1,3
\}\.
[0-9]
\{
1,3
\}
/
${
POD_IP
}
/"
"
${
DATA_DIR
}
/nodes.conf"
fi
else
echo
"Setting up redis in standalone mode"
fi
...
...
@@ -95,7 +93,11 @@ external_config() {
start_redis
()
{
if
[[
"
${
SETUP_MODE
}
"
==
"cluster"
]]
;
then
echo
"Starting redis service in cluster mode....."
if
[[
"
${
REDIS_MAJOR_VERSION
}
"
!=
"v7"
]]
;
then
redis-server /etc/redis/redis.conf
--cluster-announce-ip
"
${
POD_IP
}
"
else
redis-server /etc/redis/redis.conf
fi
else
echo
"Starting redis service in standalone mode....."
redis-server /etc/redis/redis.conf
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment