Skip to content

Commit 79d752c

Browse files
committed
Add new make command 'cli' that executes redis-cli inside the container
1 parent c3e11ba commit 79d752c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ help:
1010
@echo " run run the built docker image"
1111
@echo " bash starts bash inside a running container."
1212
@echo " clean removes the tmp cid file on disk"
13+
@echo " cli run redis-cli inside the container on the server with port 7000"
1314

1415
build:
1516
@echo "Building docker image..."
@@ -33,3 +34,6 @@ stop:
3334
clean:
3435
# Cleanup cidfile on disk
3536
-rm $(CID_FILE)
37+
38+
cli:
39+
docker exec -it $(CID) /redis/src/redis-cli -p 7000

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Or to build the image, use either `make build` or `make rebuild`. It will be bui
2424

2525
To start the image use `make run`. It will be started in the background. To gain access to the running image you can get a bash session by running `make bash`.
2626

27-
Test to connect to the cluster with `redis-cli -p 7000`. If you do not want to install a redis server on your host to get access to `redis-cli` you can run a `exec` command to run it inside the docker container. It can be done with `docker exec -it <ContainerID> /redis/src/redis-cli -p 7000` where `<ContainerID>` can be found inside the CID file at `/tmp/grokzen-redis-cluster.cid` or via `docker ps`.
27+
Redis cli can be used with `make cli` to gain access to one of the cluster servers.
2828

2929

3030

0 commit comments

Comments
 (0)