Răsfoiți Sursa

Merge pull request #855 from h3xx/simplify-mem-check

Mark Shust 2 ani în urmă
părinte
comite
523bd17dda
1 a modificat fișierele cu 4 adăugiri și 3 ștergeri
  1. 4 3
      compose/bin/setup

+ 4 - 3
compose/bin/setup

@@ -1,9 +1,10 @@
 #!/bin/bash
 set -o errexit
 
-MEM=$(docker info | grep "Total Memory" | cut -d':' -f2 | xargs | sed s/GiB//)
-# Docker reports RAM 0.2 less than what it is actually set to
-(( $(echo "$MEM < 5.7" | bc -l) )) && echo "There must be at least 6GB of RAM allocated to Docker to continue." && exit
+MEM_BYTES=$(docker info -f '{{.MemTotal}}')
+MEM_MB=$(( MEM_BYTES / 1000000 ))
+# When Docker Desktop is set to 6GB in the GUI, it is reported as 6227 MB
+(( MEM_MB < 6227 )) && echo "There must be at least 6GB of RAM allocated to Docker in order to continue." && exit
 
 # shellcheck source=../env/db.env
 source env/db.env