summaryrefslogtreecommitdiffstats
path: root/packaging/docker/run.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-01 06:15:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-01 06:15:04 +0000
commite970e0b37b8bd7f246feb3f70c4136418225e434 (patch)
tree0b67c0ca45f56f2f9d9c5c2e725279ecdf52d2eb /packaging/docker/run.sh
parentAdding upstream version 1.31.0. (diff)
downloadnetdata-e970e0b37b8bd7f246feb3f70c4136418225e434.tar.xz
netdata-e970e0b37b8bd7f246feb3f70c4136418225e434.zip
Adding upstream version 1.32.0.upstream/1.32.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/docker/run.sh')
-rwxr-xr-xpackaging/docker/run.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/packaging/docker/run.sh b/packaging/docker/run.sh
index c04be9ff8..3f05a1708 100755
--- a/packaging/docker/run.sh
+++ b/packaging/docker/run.sh
@@ -13,6 +13,23 @@ if [ ! "${DO_NOT_TRACK:-0}" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
touch /etc/netdata/.opt-out-from-anonymous-statistics
fi
+
+BALENA_PGID=$(ls -nd /var/run/balena.sock | awk '{print $4}')
+DOCKER_PGID=$(ls -nd /var/run/docker.sock | awk '{print $4}')
+
+re='^[0-9]+$'
+if [[ $BALENA_PGID =~ $re ]]; then
+ echo "Netdata detected balena-engine.sock"
+ DOCKER_HOST='/var/run/balena-engine.sock'
+ PGID="$BALENA_PGID"
+elif [[ $DOCKER_PGID =~ $re ]]; then
+ echo "Netdata detected docker.sock"
+ DOCKER_HOST="/var/run/docker.sock"
+ PGID=$(ls -nd /var/run/docker.sock | awk '{print $4}')
+fi
+export PGID
+export DOCKER_HOST
+
if [ -n "${PGID}" ]; then
echo "Creating docker group ${PGID}"
addgroup -g "${PGID}" "docker" || echo >&2 "Could not add group docker with ID ${PGID}, its already there probably"