From 1e398794bb00f1dbbf020b8ada7293c377c057dd Mon Sep 17 00:00:00 2001 From: Hu Sheng Date: Fri, 5 Jan 2024 18:39:13 +0800 Subject: [PATCH] Update docker compose document (#2997) Signed-off-by: TommyLike --- deploy/docker-compose/README.md | 14 ++++++++++++++ deploy/docker-compose/run.sh | 13 ++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/deploy/docker-compose/README.md b/deploy/docker-compose/README.md index cd0bc491a35..7e6fd952815 100644 --- a/deploy/docker-compose/README.md +++ b/deploy/docker-compose/README.md @@ -9,10 +9,18 @@ The `run.sh` script will generate config and deploy all components with `docker- Just run: ```shell +# Without network=host mode,the HOST IP would be the docker network gateway IP address, use the command below to +# obtain the ip address, "docker network inspect bridge -f '{{range .IPAM.Config}}{{.Gateway}}{{end}}'" export IP= ./run.sh ``` +## Delete containers with docker compose + +```shell +docker compose down +``` + ## Deploy without Docker Compose Just run: @@ -31,3 +39,9 @@ export IP= export RUNTIME=pouch ./run.sh container ``` + +## Delete containers without docker compose + +```shell +./run.sh delete_container +``` diff --git a/deploy/docker-compose/run.sh b/deploy/docker-compose/run.sh index b1a210cfbfb..4106b63de25 100755 --- a/deploy/docker-compose/run.sh +++ b/deploy/docker-compose/run.sh @@ -19,6 +19,15 @@ prepare(){ sed "s,__IP__,$ip," template/manager.template.yaml > config/manager.yaml } +delete_container(){ + RUNTIME=${RUNTIME:-docker} + echo use container runtime: ${RUNTIME} + + echo try to clean old containers + ${RUNTIME} rm -f dragonfly-redis dragonfly-mysql dragonfly-manager dragonfly-scheduler \ + dragonfly-dfdaemon dragonfly-seed-peer +} + run_container(){ RUNTIME=${RUNTIME:-docker} echo use container runtime: ${RUNTIME} @@ -71,7 +80,9 @@ case "$1" in container) run_container ;; - + delete_container) + delete_container + ;; *) if [ -z "$1" ]; then # start all of docker-compose defined service