From 7996c552f8f15d6add21a654dbbd077359878694 Mon Sep 17 00:00:00 2001 From: Paulo Truta Date: Sun, 5 Oct 2025 20:24:02 +0200 Subject: [PATCH] Fix runs commands on docker compose (internal) --- Makefile | 2 +- README.md | 10 ++++++---- internal/edgeapps/edgeapps.go | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 594e181..82acec5 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ run: install: @echo "šŸ“¦ Installing edgeboxctl service (${RELEASE}) for ${GOOS} (${GOARCH})\n" - @echo "🚧 Stopping edgeboxctl service if it is running" + @echo "�🚧 Stopping edgeboxctl service if it is running" sudo systemctl stop edgeboxctl || true @echo "\nšŸ—‘ļø Removing old edgeboxctl binary and service" diff --git a/README.md b/README.md index 82da0dc..2646da5 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,12 @@ To get a local copy up and running follow these simple steps. If you're running for development purposes, a docker container suffices, so make sure you have: * docker -* docker compose +* docker compose (docker-compose-v2 package) Check the following links for more info on [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/). +**Note:** If you don't have `docker compose` available, install it with: `sudo apt-get install docker-compose-v2` + Aditionally, `edgeboxctl` needs the following bash commands available wherever it runs: * `arm-linux-gnueabi-gcc` (`sudo apt-get install gcc-arm*`) @@ -79,10 +81,10 @@ Aditionally, `edgeboxctl` needs the following bash commands available wherever i ```sh git clone https://github.com/edgebox-iot/edgeboxctl.git ``` -2. Run Docker-Compose -```sh -docker-compose up +2. Run Docker Compose + ``` +docker compose up diff --git a/internal/edgeapps/edgeapps.go b/internal/edgeapps/edgeapps.go index bd98be7..d310df6 100644 --- a/internal/edgeapps/edgeapps.go +++ b/internal/edgeapps/edgeapps.go @@ -489,7 +489,7 @@ func GetEdgeAppServices(ID string) []EdgeAppService { // Check if the service is actually running if shouldBeRunning { cmdArgs = []string{"-f", wsPath + "/docker-compose.yml", "exec", "-T", serviceID, "echo", "'Service Check'"} - cmdResult := utils.Exec(wsPath, "docker-compose", cmdArgs) + cmdResult := utils.Exec(wsPath, "docker", append([]string{"compose"}, cmdArgs...)) if cmdResult != "" { isRunning = true } @@ -511,7 +511,7 @@ func RunEdgeApp(ID string) EdgeAppStatus { for _, service := range services { cmdArgs = []string{"-f", wsPath + "/docker-compose.yml", "start", service.ID} - utils.Exec(wsPath, "docker-compose", cmdArgs) + utils.Exec(wsPath, "docker", append([]string{"compose"}, cmdArgs...)) } // Wait for it to settle up before continuing... @@ -529,7 +529,7 @@ func StopEdgeApp(ID string) EdgeAppStatus { for _, service := range services { cmdArgs = []string{"-f", wsPath + "/docker-compose.yml", "stop", service.ID} - utils.Exec(wsPath, "docker-compose", cmdArgs) + utils.Exec(wsPath, "docker", append([]string{"compose"}, cmdArgs...)) } // Wait for it to settle up before continuing...