From 5294a799330522f8957357c1426730ba9ae86a7d Mon Sep 17 00:00:00 2001 From: bradsawadye Date: Fri, 26 Jul 2024 12:30:28 +0200 Subject: [PATCH] Make the docker info folder configurable through env variables This is to cater for the ehtipoia use case where the docker folders are stored in a different location --- monitoring/docker-compose.cluster.yml | 2 +- monitoring/docker-compose.yml | 6 +++--- monitoring/package-metadata.json | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/monitoring/docker-compose.cluster.yml b/monitoring/docker-compose.cluster.yml index 87eb7d62..bbbb1996 100644 --- a/monitoring/docker-compose.cluster.yml +++ b/monitoring/docker-compose.cluster.yml @@ -18,7 +18,7 @@ services: replicas: 1 volumes: - prometheus_data_backup:/prometheus - - /var/run/docker.sock:/var/run/docker.sock:ro + - ${DOCKER_SOCK_FOLDER}:/var/run/docker.sock:ro configs: - target: /etc/prometheus/prometheus.yml source: prometheus.yml diff --git a/monitoring/docker-compose.yml b/monitoring/docker-compose.yml index 3431a17b..faeb1538 100644 --- a/monitoring/docker-compose.yml +++ b/monitoring/docker-compose.yml @@ -75,7 +75,7 @@ services: user: root volumes: - prometheus-data:/prometheus - - /var/run/docker.sock:/var/run/docker.sock:ro + - ${DOCKER_SOCK_FOLDER}:/var/run/docker.sock:ro configs: - target: /etc/prometheus/prometheus.yml source: prometheus.yml @@ -97,7 +97,7 @@ services: - /:/rootfs:ro - /var/run:/var/run - /sys:/sys:ro - - /var/lib/docker/:/var/lib/docker + - ${DOCKER_LIB_FOLDER}:/var/lib/docker - /dev/disk/:/dev/disk:ro deploy: mode: global @@ -131,7 +131,7 @@ services: promtail: image: ${PROMTAIL_IMAGE} volumes: - - /var/lib/docker/containers:/host/containers + - ${DOCKER_LIB_FOLDER}/containers:/host/containers - /var/log:/var/log:ro configs: - target: /etc/promtail/promtail-config.yml diff --git a/monitoring/package-metadata.json b/monitoring/package-metadata.json index b1d7b9b3..82dc6b54 100644 --- a/monitoring/package-metadata.json +++ b/monitoring/package-metadata.json @@ -34,6 +34,8 @@ "MO_SECURITY_ADMIN_PASSWORD": "dev_password_only", "MO_RETENTION_TIME": "15d", "GF_SERVER_SERVE_FROM_SUB_PATH": "false", - "MINIO_BROWSER_REDIRECT_URL": "" + "MINIO_BROWSER_REDIRECT_URL": "", + "DOCKER_SOCK_FOLDER": "/var/run/docker.sock", + "DOCKER_LIB_FOLDER": "/var/lib/docker/" } }