diff options
author | Joel Hans <joel@netdata.cloud> | 2020-10-26 10:54:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-26 13:54:46 -0400 |
commit | dee7d475695c442acb2328c1fce4a1291cac44ce (patch) | |
tree | f69d1fad8b394bd5b3453f307bbd409fb614bfab /packaging/docker | |
parent | 5d60c8576c487541edf88478871c8a1e4ec20b73 (diff) |
Add documentation for configuring/editing hostnames of Docker-run Agents (#10087)
* Add doc for Docker hostname
* Small tweak
* Remove extra w
Diffstat (limited to 'packaging/docker')
-rw-r--r-- | packaging/docker/README.md | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/packaging/docker/README.md b/packaging/docker/README.md index 2b53f5f837..ecdde44099 100644 --- a/packaging/docker/README.md +++ b/packaging/docker/README.md @@ -119,9 +119,9 @@ need to use a non-default configuration for health checks to work. ## Configure Agent containers -If you started an Agent container using one of the [recommended methods](#create-a-new-netdata-agent-container), you -must first use `docker exec` to attach to the container. Replace `netdata` with the name of your Agent container in the -first command below. +If you started an Agent container using one of the [recommended methods](#create-a-new-netdata-agent-container) and you +want to edit Netdata's configuration, you must first use `docker exec` to attach to the container. Replace `netdata` +with the name of your container. ```bash docker exec -it netdata bash @@ -199,6 +199,37 @@ volumes: netdatacache: ``` +### Change the default hostname + +You can change the hostname of a Docker container, and thus the name that appears in the local dashboard and in Netdata +Cloud, when creating a new container. If you want to change the hostname of a Netdata container _after_ you started it, +you can safely stop and remove it. You configuration and metrics data reside in persistent volumes and are reattached to +the recreated container. + +If you use `docker-run`, use the `--hostname` option with `docker run`. + +```bash +docker run -d --name=netdata \ + --hostname=my_docker_netdata +``` + +If you use `docker-compose`, add a `hostname:` key/value pair into your `docker-compose.yml` file, then create the +container again using `docker-compose up -d`. + +```yaml +version: '3' +services: + netdata: + image: netdata/netdata + container_name: netdata + hostname: my_docker_compose_netdata + ... +``` + +If you don't want to destroy and recreate your container, you can edit the Agent's `netdata.conf` file directly. See the +above section on [configuring Agent containers](#configure-agent-containers) to find the appropriate method based on +how you created the container. + ### Add or remove other volumes Some of the volumes are optional depending on how you use Netdata: |