mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-08 17:42:56 +01:00
Add redis-cluster-6.2.12 image for CI pipeline
This commit is contained in:
parent
6152a3f676
commit
bc24429310
3 changed files with 38 additions and 0 deletions
|
|
@ -73,3 +73,6 @@ postgres-14-pgvector-0.4.1:
|
|||
|
||||
postgres-15-pgvector-0.4.1:
|
||||
extends: .build_static_image
|
||||
|
||||
redis-cluster-6.2.12:
|
||||
extends: .build_static_image
|
||||
|
|
|
|||
11
Dockerfile.redis-cluster-6.2.12
Normal file
11
Dockerfile.redis-cluster-6.2.12
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
FROM redis:6.2.12
|
||||
|
||||
ENV HOME /root
|
||||
|
||||
COPY scripts/run-redis-cluster /docker-entrypoint.sh
|
||||
|
||||
RUN chmod 755 /docker-entrypoint.sh
|
||||
|
||||
EXPOSE 7001 7002 7003
|
||||
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
24
scripts/run-redis-cluster
Executable file
24
scripts/run-redis-cluster
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Approach references https://docs.docker.com/config/containers/multi-service_container/#use-a-wrapper-script
|
||||
# This script starts 3 Redis server process in the background and syncs them after a short wait.
|
||||
|
||||
start_redis_server() {
|
||||
redis-server --port $1\
|
||||
--cluster-enabled yes \
|
||||
--cluster-node-timeout 5000 \
|
||||
--bind 127.0.0.1 \
|
||||
--cluster-config-file "$2" &
|
||||
}
|
||||
|
||||
start_redis_server 7001 nodes-1.conf
|
||||
start_redis_server 7002 nodes-2.conf
|
||||
start_redis_server 7003 nodes-3.conf
|
||||
|
||||
sleep 3
|
||||
|
||||
redis-cli --cluster create 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 --cluster-yes
|
||||
|
||||
wait -n
|
||||
|
||||
exit $?
|
||||
Loading…
Add table
Add a link
Reference in a new issue