From 7773b5ee330014dced7b037d0774e41dd68efafa Mon Sep 17 00:00:00 2001
From: Leny <8152038+Leny1996@users.noreply.github.com>
Date: Tue, 1 Aug 2023 23:16:08 +0200
Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20docker=20bind-mount=20sto?=
 =?UTF-8?q?ck=20files=20creation=20(#15639)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 packaging/docker/run.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/packaging/docker/run.sh b/packaging/docker/run.sh
index ed77c394a7..eede14e382 100755
--- a/packaging/docker/run.sh
+++ b/packaging/docker/run.sh
@@ -46,9 +46,10 @@ if [ -n "${PGID}" ]; then
   usermod -a -G "${PGID}" "${DOCKER_USR}" || echo >&2 "Could not add netdata user to group docker with ID ${PGID}"
 fi
 
-if mountpoint -q /etc/netdata && [ -z "$(ls -A /etc/netdata)" ]; then
+if mountpoint -q /etc/netdata; then
   echo "Copying stock configuration to /etc/netdata"
-  cp -a /etc/netdata.stock/. /etc/netdata
+  cp -an /etc/netdata.stock/* /etc/netdata
+  cp -an /etc/netdata.stock/.[^.]* /etc/netdata
 fi
 
 if [ -w "/etc/netdata" ]; then