hocus-dev / hocus

🪄 Spin up ready-to-code, disposable dev environments on your own servers. Self-hosted alternative to Gitpod and Github Codespaces.
https://hocus.dev
MIT License
3.23k stars 82 forks source link

local-up.sh : Error interpreting the docker compose version #140

Open hberro opened 1 year ago

hberro commented 1 year ago

🐛 Bug description

Environment

Details

Hello, first of all thank you this project and for what has already been achieved. I was looking forward to test the current state of hocus but I encountered a minor error during the first build.

The installation script exited as error because it couldn't interpret the docker compose version, although I installed the latter using the recommended method on the official docker website (DEB file).

I had to do the following change in local-up.sh to go through:

$ git diff
diff --git a/ops/bin/local-up.sh b/ops/bin/local-up.sh
index b2697e2..3ad18b6 100755
--- a/ops/bin/local-up.sh
+++ b/ops/bin/local-up.sh
@@ -170,7 +170,7 @@ if [ -z ${HOCUS_BUILD_COMMIT_HASH+x} ]; then
   EXTRA_PULL_FLAGS=--ignore-buildable
   # Check minimum version of docker compose
   # We require docker compose of at least version 2.15.0 which introduced --ignore-buildable
-  COMPOSE_VERSION="$(docker compose version | grep -o -E '[0-9]+(\.[0-9]+){2}$')"
+  COMPOSE_VERSION="$(docker compose version | grep -o -E '[0-9]+(\.[0-9]+){2}-desktop\.1$')"
   COMPOSE_REQUIRED_VERSION="2.15.0"

For information, here are the brut outputs regarding docker and docker compose versions.

$ docker compose version
Docker Compose version v2.20.2-desktop.1
$ docker version
Client: Docker Engine - Community
 Cloud integration: v1.0.35-desktop+001
 Version:           24.0.5
 API version:       1.43
 Go version:        go1.20.6
 Git commit:        ced0996
 Built:             Fri Jul 21 20:35:18 2023
 OS/Arch:           linux/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.22.0 (117440)
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.6
  Git commit:       a61e2b4
  Built:            Fri Jul 21 20:35:45 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0