Last active
November 21, 2023 13:05
-
-
Save zeerorg/91cf72e34bb3749c9b311c1264fd003d to your computer and use it in GitHub Desktop.
Macos docker run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
container_name="local-redis" | |
if [ "$( docker container inspect -f '{{.State.Status}}' $container_name )" = "running" ]; then | |
docker stop $container_name | |
fi | |
if docker ps -a --format '{{.Names}}' | grep -q "^$container_name$"; then | |
docker rm $container_name | |
fi | |
docker run -d -e "IP=0.0.0.0" -p 7000-7005:7000-7005 --name $container_name grokzen/redis-cluster:latest | |
sleep 10 | |
docker exec $container_name /bin/bash -c 'for port in {7000..7005}; do | |
echo "CONFIG SET protected-mode no" | redis-cli -p $port; | |
echo "CONFIG REWRITE" | redis-cli -p $port; | |
done' |
Author
zeerorg
commented
Nov 9, 2023
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment