Skip to content
Snippets Groups Projects

Docker checks

Merged Hahn Axel (hahn) requested to merge docker-checks into master
2 files
+ 21
17
Compare changes
  • Side-by-side
  • Inline

Files

+ 2
17
@@ -45,7 +45,7 @@ OPTIONS:
@@ -45,7 +45,7 @@ OPTIONS:
General:
General:
-h, --help this help
-h, --help this help
-d, --debug Debug; Flag: show all docker system infos
-d, --debug Debug; Flag: show docker env values.
Connect to docker:
Connect to docker:
-p, --path Custom directory for docker binary
-p, --path Custom directory for docker binary
@@ -127,22 +127,7 @@ _detectDockerenv
@@ -127,22 +127,7 @@ _detectDockerenv
# --- get stats data
# --- get stats data
data=$( sudo -n --preserve-env docker stats --no-stream --format '{{ json . }}' )
data=$( sudo -n --preserve-env docker stats --no-stream --format '{{ json . }}' )
_detectDockererror "$data"
if [ -z "$data" ]; then
# zero output could mean:
# - connect to docker failed
# - no data because no container is running
# --> let's detect it...
infos=$( sudo -n --preserve-env docker system info --format '{{ json . }}' )
_detectDockererror "$infos"
typeset -i iCRunning;
iCRunning=$(_getString "$data" ".ContainersRunning" )
if [ "$iCRunning" -eq "0" ]; then
ph.status "$sLabel >> Do data. No container is running"
ph.exit
fi
fi
# --- checks to detect maximum
# --- checks to detect maximum
Loading