From 798ebb710af3ce49de156434d5754de71b995ddc Mon Sep 17 00:00:00 2001 From: Gaius Date: Wed, 27 Apr 2022 14:30:07 +0800 Subject: [PATCH] fix: docker compose run.sh (#1282) Signed-off-by: Gaius --- deploy/docker-compose/README.md | 7 +++++++ deploy/docker-compose/run.sh | 13 +++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/deploy/docker-compose/README.md b/deploy/docker-compose/README.md index cd0bc491a35..a0b9cb0eeef 100644 --- a/deploy/docker-compose/README.md +++ b/deploy/docker-compose/README.md @@ -2,6 +2,13 @@ > Currently, docker compose deploying is tested just in single host, no HA support. +Please replace the `sed` with `gnu-sed` in macOS. + +```shell +brew install gnu-sed +alias sed=gsed +``` + ## Deploy with Docker Compose The `run.sh` script will generate config and deploy all components with `docker-compose`. diff --git a/deploy/docker-compose/run.sh b/deploy/docker-compose/run.sh index 078324e27bc..285726afad8 100755 --- a/deploy/docker-compose/run.sh +++ b/deploy/docker-compose/run.sh @@ -11,12 +11,17 @@ cd $DIR prepare(){ mkdir -p config + cat template/cdn.template.yaml > config/cdn.yaml + cat template/dfget.template.yaml > config/dfget.yaml + cat template/scheduler.template.yaml > config/scheduler.yaml + cat template/manager.template.yaml > config/manager.yaml + ip=${IP:-$(hostname -i)} - sed "s,__IP__,$ip," config/dfget.yaml > config/dfget.yaml - sed "s,__IP__,$ip," config/cdn.yaml > config/cdn.yaml - sed "s,__IP__,$ip," config/scheduler.yaml > config/scheduler.yaml - sed "s,__IP__,$ip," config/manager.yaml > config/manager.yaml + sed -i "s,__IP__,$ip," config/dfget.yaml + sed -i "s,__IP__,$ip," config/cdn.yaml + sed -i "s,__IP__,$ip," config/scheduler.yaml + sed -i "s,__IP__,$ip," config/manager.yaml } run_container(){