summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2022-09-30 09:17:10 -0400
committerGitHub <noreply@github.com>2022-09-30 09:17:10 -0400
commit0e2033c743163f9b1193666a8d7e04e28ea2fc2d (patch)
tree2d71aa07e7acbc45be7f090805d70ec477b797d0 /packaging
parenta8b4b1ec81a17cdbdf3062b5e2265dc88f60ba5f (diff)
Add info for Docker containers about using hostname from host. (#13685)
* Add info for Docker containers about using hostname from host. By directly mounting `/etc/hostname` into the container read-only. * Update packaging/docker/README.md Co-authored-by: DShreve2 <david@netdata.cloud> * Update packaging/docker/README.md Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud> Co-authored-by: DShreve2 <david@netdata.cloud> Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/docker/README.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/packaging/docker/README.md b/packaging/docker/README.md
index e3697fdaae..d00262a1b0 100644
--- a/packaging/docker/README.md
+++ b/packaging/docker/README.md
@@ -252,6 +252,11 @@ If you don't want to destroy and recreate your container, you can edit the Agent
above section on [configuring Agent containers](#configure-agent-containers) to find the appropriate method based on
how you created the container.
+Alternatively, you can directly use the hostname from the node running the container by mounting
+`/etc/hostname` from the host in the container. With `docker run`, this can be done by adding `--volume
+/etc/hostname:/etc/hostname:ro` to the options. If you are using Docker Compose, you can add an entry to the
+container's `volumes` section reading `- /etc/hostname:/etc/hostname:ro`.
+
### Add or remove other volumes
Some volumes are optional depending on how you use Netdata: