diff options
Diffstat (limited to 'packaging')
-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 |