diff options
author | Andrew Moss <1043609+amoss@users.noreply.github.com> | 2020-01-21 16:08:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-21 16:08:59 +0100 |
commit | 49f6950820f083956ddc2c9327eeae4e9ef0d5ed (patch) | |
tree | c551bb219e2503c55e3b4e668408d4bff9ac99d8 /packaging | |
parent | 434c9ba6e17aa80548e1fccbcadccaa1572d76eb (diff) |
Issue 7488 docker labels (#7770)
Improve the metadata detection for containers. The system_info structure has been updated to hold separate copies of OS_NAME, OS_ID, OS_ID_LIKE, OS_VERSION, OS_VERSION_ID and OS_DETECTION for both the container environment and the host. This new information is communicated through the /api/v1/info endpoint. For the streaming interface a partial copy of the info is carried until the stream protocol is upgraded. The anonymous_statistics script has been updated to carry the new data to Google Analytics. Some minor improvements have been made to OS-X / FreeBSD detection, and the detection of virtualization. The docs have been updated to explain how to pass the host environment to the docker container running Netdata.
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/docker/README.md | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/packaging/docker/README.md b/packaging/docker/README.md index 6ef3497234..2d09b0d8e6 100644 --- a/packaging/docker/README.md +++ b/packaging/docker/README.md @@ -35,6 +35,7 @@ docker run -d --name=netdata \ -v /etc/group:/host/etc/group:ro \ -v /proc:/host/proc:ro \ -v /sys:/host/sys:ro \ + -v /etc/os-release:/host/etc/os-release:ro \ --cap-add SYS_PTRACE \ --security-opt apparmor=unconfined \ netdata/netdata @@ -61,8 +62,26 @@ services: - /sys:/host/sys:ro ``` -If you don't want to use the apps.plugin functionality, you can remove the mounts of `/etc/passwd` and `/etc/group` -(they are used to get proper user and group names for the monitored host) to get slightly better security. +Some of the bind-mounts are optional depending on how you use Netdata: + +* If you don't want to use the apps.plugin functionality, you can remove the mounts of `/etc/passwd` and `/etc/group` + (they are used to get proper user and group names for the monitored host) to get slightly better security. + +* Most modern linux distos supply `/etc/os-release` although some older distros only supply `/etc/lsb-release`. If + this is the case you can change the line above that mounts the file inside the container to + `-v /etc/lsb-release:/host/etc/lsb-release:ro`. + +* If your host is virtualized then Netdata cannot detect it from inside the container and will output the wrong + metadata (e.g. on `/api/v1/info` queries). You can fix this by setting a variable that overrides the detection + using, e.g. `--env VIRTUALIZATION=$(systemd-detect-virt -v)`. If you are using a `docker-compose.yml` then add: +``` + environment: + - VIRTUALIZATION=${VIRTUALIZATION} +``` +This allows the information to be passed into `docker-compose` using: +``` +VIRTUALIZATION=$(systemd-detect-virt -v) docker-compose up +``` Starting with v1.12, Netdata collects anonymous usage information by default and sends it to Google Analytics. Read about the information collected, and learn how to-opt, on our [anonymous statistics](../../docs/anonymous-statistics.md) |