From 47d335cf8cbe9bdbb3929281271c34953cba5588 Mon Sep 17 00:00:00 2001 From: Kaiwalya Joshi Date: Wed, 1 Jun 2022 15:47:10 -0700 Subject: [PATCH] feat: Send commands to weed shell from the docker image. Add the ability to send commands to weed shell from the docker image. Allows an operator to perform maintenance commands like so: ``` docker run \ --rm \ -e SHELL_FILER=localhost:8888 \ -e SHELL_MASTER=localhost:9333 \ chrislusf/seaweedfs:local \ "shell" \ "fs.configure -locationPrefix=/buckets/foo -volumeGrowthCount=3 -replication=002 -apply" ``` --- docker/entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 6818d9581..80a7fe586 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -57,6 +57,12 @@ case "$1" in exec /usr/bin/weed -logtostderr=true s3 $ARGS $@ ;; + 'shell') + ARGS="-cluster=$SHELL_CLUSTER -filer=$SHELL_FILER -filerGroup=$SHELL_FILER_GROUP -master=$SHELL_MASTER -options=$SHELL_OPTIONS" + shift + exec echo "$@" | /usr/bin/weed -logtostderr=true shell $ARGS + ;; + *) exec /usr/bin/weed $@ ;;