diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2022-12-08 11:15:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-08 11:15:31 +0200 |
commit | d0dad4459ee5bece15a3b2bb88149956d495fbb3 (patch) | |
tree | f016e9e8c0a85c3d7867aca100897f83429ba0a4 | |
parent | bf8f277746cf912b2e12c5c5248866cd126767b9 (diff) |
fix docker host editable config (#14104)
Fixes https://github.com/netdata/netdata/issues/14103
-rw-r--r-- | packaging/docker/README.md | 4 | ||||
-rwxr-xr-x | packaging/docker/run.sh | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/packaging/docker/README.md b/packaging/docker/README.md index 11f3a6a12c..81cfd9b183 100644 --- a/packaging/docker/README.md +++ b/packaging/docker/README.md @@ -196,12 +196,12 @@ docker rm -f netdata_tmp ``` **`docker run`**: Use the `docker run` command, along with the following options, to start a new container. Note the -changed `-v $(pwd)/netdataconfig/netdata:/etc/netdata:ro \` line from the recommended example above. +changed `-v $(pwd)/netdataconfig/netdata:/etc/netdata \` line from the recommended example above. ```bash docker run -d --name=netdata \ -p 19999:19999 \ - -v $(pwd)/netdataconfig/netdata:/etc/netdata:ro \ + -v $(pwd)/netdataconfig/netdata:/etc/netdata \ -v netdatalib:/var/lib/netdata \ -v netdatacache:/var/cache/netdata \ -v /etc/passwd:/host/etc/passwd:ro \ diff --git a/packaging/docker/run.sh b/packaging/docker/run.sh index 244f92c421..9029e22b61 100755 --- a/packaging/docker/run.sh +++ b/packaging/docker/run.sh @@ -49,10 +49,12 @@ if mountpoint -q /etc/netdata && [ -z "$(ls -A /etc/netdata)" ]; then cp -a /etc/netdata.stock/. /etc/netdata fi -if mountpoint -q /etc/netdata; then - hostname > /etc/netdata/.container-hostname -else - rm -f /etc/netdata/.container-hostname +if [ -w "/etc/netdata" ]; then + if mountpoint -q /etc/netdata; then + hostname >/etc/netdata/.container-hostname + else + rm -f /etc/netdata/.container-hostname + fi fi if [ -n "${NETDATA_CLAIM_URL}" ] && [ -n "${NETDATA_CLAIM_TOKEN}" ] && [ ! -f /var/lib/netdata/cloud.d/claimed_id ]; then |